Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
HttpCookieCollection Help
Old 01-07-2006, 02:49 AM HttpCookieCollection Help
Super Talker

Posts: 148
Trades: 0
I am trying to write data as shown below in my cookie collection.

Code:
Response.Cookies("cookieCollection")("name") = txtName.Text
Response.Cookies("cookieCollection")("sdate") = txtStartDate.Text
Response.Cookies("cookieCollection")("ddate") = txtEndDate.Text
Response.Cookies("cookieCollection")("disc") = txtDiscount.Text
Response.Cookies("cookieCollection")("branch") = dropBranch.SelectedValue
However, i am not sure how to retrieve the cookies. I know you must use "request.cookies" if i am not wrong. I tried the code below but do not think its working, in fact it gives me an error. Anyone can help me out? Thanks

Code:
Dim tempCookie As HttpCookie
                For Each tempCookie In Request.Cookies
                    If tempCookie("addProm") Then
                        Response.Write(tempCookie("name"))
                    End If
                Next
shaoen01 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-07-2006, 06:00 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
and the error message is ?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-07-2006, 01:51 PM
Super Talker

Posts: 148
Trades: 0
Error msg is: Specified cast is not valid.

Code:
Line 50:                 Response.Cookies("saleItemIds").Expires = Now.AddDays(-1)
Line 51:                 Dim tempCookie As HttpCookie
Line 52:                 For Each tempCookie In Request.Cookies
Line 53:                     If tempCookie("addProm") Then
Line 54:                         Response.Write(tempCookie("name"))
shaoen01 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to HttpCookieCollection Help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.67533 seconds with 12 queries