|
|
| View previous topic :: View next topic |
| Message |
|
Author
|
ronischuetz
Newbie
|
Joined: 24 Jul 2006
Posts: 5
|
|
Posted: Mon Jul 24, 2006 4:00 am
Post subject: cookie info within ajax method |
|
|
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 |
|
 |
|
Author
|
AlbertWeinert
Newbie
|
Joined: 12 Jul 2006
Posts: 42
|
|
Posted: Tue Jul 25, 2006 4:00 am
Post subject: |
|
|
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 |
|
 |
|
Author
|
MichaelSchwarz
Intermediate
|
Joined: 11 Jul 2006
Posts: 252
|
|
Posted: Tue Jul 25, 2006 4:00 am
Post subject: |
|
|
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 |
|
 |
|
Author
|
GeoffreySwenson
Newbie
|
Joined: 21 Jul 2006
Posts: 11
|
|
Posted: Tue Jul 25, 2006 4:00 am
Post subject: |
|
|
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 |
|
 |
|
|
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
|
|