FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister  MasterVB.NET
Visual Basic 2005 .NET Forum
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
cookie info within ajax method
 
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Web Forms
View previous topic :: View next topic  
Message
Author
ronischuetz
Newbie
Joined: 24 Jul 2006
Posts: 5

PostPosted: Mon Jul 24, 2006 4:00 am    
Post subject: cookie info within ajax method
Reply with quote

Request 'Request' threw an exception of type
'System.NullReferenceException' System.Web.HttpRequest
{System.NullReferenceException}

Response 'Response' threw an exception of type
'System.NullReferenceException' System.Web.HttpResponse
{System.NullReferenceException}


in a previous post from michal i read that its possible to read cookie information within my ajax method, somehow i get in cases of request and response always a NullReferneceException...

any idea?



 

Back to top
View user's profile Send private message
Author
AlbertWeinert
Newbie
Joined: 12 Jul 2006
Posts: 42

PostPosted: Tue Jul 25, 2006 4:00 am    
Post subject:
Reply with quote

roni schuetz schrieb:
Quote:
Request 'Request' threw an exception of type
'System.NullReferenceException' System.Web.HttpRequest
{System.NullReferenceException}

Response 'Response' threw an exception of type
'System.NullReferenceException' System.Web.HttpResponse
{System.NullReferenceException}

any idea?

Ronni, please write this 100 times on the chalkboard.


I have no initialized Page Object within Ajax Request.

*grins*

And use System.Web.HttpContext.Current.Request System.Web.HttpContext.Current.Response



--
Freundliche Grüße

Albert Weinert

http://der-albert.com


 

Back to top
View user's profile Send private message
Author
MichaelSchwarz
Intermediate
Joined: 11 Jul 2006
Posts: 252

PostPosted: Tue Jul 25, 2006 4:00 am    
Post subject:
Reply with quote

You can read and write cookies with HttpContext.Current.

Regards Michael

On 7/24/06, Geoffrey Swenson <geoffrey> wrote:
Quote:

I don't think you can read cookies from AJAX. You are going to have to read
cookies while you are loading the page, and either put the results in hidden
fields or in javascript variables (you can encrypt this if you wish) and
pass them back when you call the AJAX function.

You can also store the cookie data in a database on the server, so all you
would have to pass is a record id.

Geoffrey J. Swenson
geoffrey


-----Original Message-----
From: ajaxpro [mailto:ajaxpro] On Behalf
Of Albert Weinert
Sent: Sunday, July 23, 2006 10:31 PM
To: ajaxpro
Subject: [ajaxpro] Re: cookie info within ajax method


roni schuetz schrieb:
> Request 'Request' threw an exception of type
> 'System.NullReferenceException' System.Web.HttpRequest
> {System.NullReferenceException}
>
> Response 'Response' threw an exception of type
> 'System.NullReferenceException' System.Web.HttpResponse
> {System.NullReferenceException}
>
> any idea?

Ronni, please write this 100 times on the chalkboard.

I have no initialized Page Object within Ajax Request.

*grins*

And use
System.Web.HttpContext.Current.Request
System.Web.HttpContext.Current.Response



--
Freundliche Grüße

Albert Weinert

http://der-albert.com



>



--

Best regards | Schöne Grüße Michael

Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer

http://weblogs.asp.net/mschwarz/
http://www.schwarz-interactive.de/

Skype: callto:schwarz-interactive MSN IM: passport


 

Back to top
View user's profile Send private message
Author
GeoffreySwenson
Newbie
Joined: 21 Jul 2006
Posts: 11

PostPosted: Tue Jul 25, 2006 4:00 am    
Post subject:
Reply with quote

I don't think you can read cookies from AJAX. You are going to have to read cookies while you are loading the page, and either put the results in hidden fields or in javascript variables (you can encrypt this if you wish) and pass them back when you call the AJAX function.

You can also store the cookie data in a database on the server, so all you would have to pass is a record id.

Geoffrey J. Swenson geoffrey


-----Original Message-----
From: ajaxpro [mailto:ajaxpro] On Behalf Of Albert Weinert Sent: Sunday, July 23, 2006 10:31 PM To: ajaxpro Subject: [ajaxpro] Re: cookie info within ajax method


roni schuetz schrieb:
Quote:
Request 'Request' threw an exception of type
'System.NullReferenceException' System.Web.HttpRequest
{System.NullReferenceException}

Response 'Response' threw an exception of type
'System.NullReferenceException' System.Web.HttpResponse
{System.NullReferenceException}

any idea?

Ronni, please write this 100 times on the chalkboard.


I have no initialized Page Object within Ajax Request.

*grins*

And use System.Web.HttpContext.Current.Request System.Web.HttpContext.Current.Response



--
Freundliche Grüße

Albert Weinert

http://der-albert.com




 

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Web Forms All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Archieve

Powered by phpBB © 2001, 2002 phpBB Group, used in Visual Basic 2005 .NET Forum

| Visual Basic .NET Forum | Online Recipe Archiver | Shareware Freeware PAD | Lowongan Kerja | Kamus Online | Health Supply | Digital Camera Review |
Orang Paling Keren

RSS