|
-
May 20th, 2004, 12:36 PM
#1
Thread Starter
Fanatic Member
Am i missing something here with cookies
OK back in the normal asp days setting and reading a cookie was so dam simple
response.cookies("blah") = blah &
request.cookies("blah")
ok now the .net way (*** is that all about)
ok heres my real question
i have a control which handles the left hand side of my website on here ive got a littie area which displays users shopping cart so therefore i store the users cart id in the cookie,
when ever i load the index page is get this error
VB Code:
If Request.Cookies("CartCookie").Value >= 0 Then
Object reference not set to an instance of an object.
its because i havnt defined the NEW part of the cookie...
So if i do instead
VB Code:
Dim cookie As HttpCookie = New HttpCookie("CartCookie")
if cookie.value > 0 then
It allows me to run the page without errors, however every time i add to the cart its panel in this control is never displayed....
Now am i just being thick or what
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
May 20th, 2004, 12:52 PM
#2
I wonder how many charact
Perhaps the real question is whether that code is executing before the page has finished loading its controls and state.
What event does that code run in your user control?
-
May 20th, 2004, 01:05 PM
#3
Thread Starter
Fanatic Member
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
May 20th, 2004, 05:21 PM
#4
I wonder how many charact
Normally I would say try the PreRender event, but that shouldn't make a difference for the Request object.
You stated assigning a new instance worked, but weren't too clear about 'its panel' not displaying...?
Last edited by nemaroller; May 20th, 2004 at 05:24 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|