Reply
Web Forms Using Cookies....
Old 08-11-2009, 11:36 AM Web Forms Using Cookies....
mb2000inc's Avatar
Super Talker

Posts: 118
Name: Mark
Location: Ohio
Trades: 0
I've never had to use cookies before, but it seems like a good idea.

So here's a little history on this project. I was given this project from a newly made FORMER employee... We had a series of Classic ASP Forms (a questionnaire - 6 pages) used to gather customer data and help them determine what path is right for them. At the end of the series of forms, the information is gathered and an assessment is made - their information is either emailed to them or they can choose to print it.

The values are being passed by query string into hidden textboxes. It's time to revamp this questionnaire. What better way to do so than to bring it into the DOT NET erra?

The Solution:
What I would like to do, is store the information in a cookie on their machine that gets read at the end of the questionnaire and posted on the screen for their information. Each page has about 6-8 questions that gather information. Most of the responses required are simple yes/no answers (via check boxes).

The Question:
Now, how do I go about doing it? I've never had to use cookies before. Any input would be appreciated.
(again, as I usually put into these requests, I'm a VB man - But am willing to learn C# - slowly)

Thanks in advance.
__________________
Need a vacation.
mb2000inc is offline
Reply With Quote
View Public Profile Visit mb2000inc's homepage!
 
 
When You Register, These Ads Go Away!
Old 08-12-2009, 08:51 AM Re: Web Forms Using Cookies....
Skilled Talker

Posts: 69
Trades: 0
Just a thought, but why not use a Session object rather than using cookies. Do you want this information saved for them even after they close the browser?
stbuchok is offline
Reply With Quote
View Public Profile
 
Old 08-12-2009, 10:17 AM Re: Web Forms Using Cookies....
mb2000inc's Avatar
Super Talker

Posts: 118
Name: Mark
Location: Ohio
Trades: 0
I spent the majority of the day, yesterday googling that kind of stuff. What I really need is to find a really good example that I can get into and play with. I'm the kinda guy that needs to have it right in front of them to dig into it and find out how it works. I need the hands on in order to learn. I'm a dork that way.

Quote:
Do you want this information saved for them even after they close the browser?
But in answer to your question... no, the information does not need to be saved. It's only there for the time that the window is open. After that, the cookie can be deleted.
__________________
Need a vacation.
mb2000inc is offline
Reply With Quote
View Public Profile Visit mb2000inc's homepage!
 
Old 08-12-2009, 12:48 PM Re: Web Forms Using Cookies....
Skilled Talker

Posts: 69
Trades: 0
I would use Sessions then in your case.

http://msdn.microsoft.com/en-us/libr...06(VS.71).aspx
http://msdn.microsoft.com/en-us/libr...25(VS.71).aspx
stbuchok is offline
Reply With Quote
View Public Profile
 
Old 08-13-2009, 04:26 PM Re: Web Forms Using Cookies....
mb2000inc's Avatar
Super Talker

Posts: 118
Name: Mark
Location: Ohio
Trades: 0
OK, I read your links... started playing... now I have to contend with the web.config file. How do I add the session state?

The examples I was given all show a database connection string, etc... and I don't want that.
Code:
   <sessionState  
           mode="InProc" 
           stateConnectionString="tcpip=127.0.0.1:42424" 
           sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" 
           cookieless="false"  
           timeout="20"  
   /> 
I tried to take it out and I keep getting an error:
Quote:
ASP.NET runtime error: Unrecognized Configuration Section Sessionstate.
__________________
Need a vacation.
mb2000inc is offline
Reply With Quote
View Public Profile Visit mb2000inc's homepage!
 
Old 08-14-2009, 11:57 AM Re: Web Forms Using Cookies....
mb2000inc's Avatar
Super Talker

Posts: 118
Name: Mark
Location: Ohio
Trades: 0
ok, so I figured out how to get the session started, and create the cookies without error....

But the problem is, that I can't get the values to go from page to page.

Any thoughts? Would you like to see the project I'm working on? I will attach it to the thread if you think it will help.
(keep in mind that this is a work related project and discretion is a must.)
__________________
Need a vacation.

Last edited by mb2000inc; 08-14-2009 at 11:58 AM.. Reason: I can't type
mb2000inc is offline
Reply With Quote
View Public Profile Visit mb2000inc's homepage!
 
Old 08-14-2009, 02:39 PM Re: Web Forms Using Cookies....
mb2000inc's Avatar
Super Talker

Posts: 118
Name: Mark
Location: Ohio
Trades: 0
I GOT IT!!!!!

I wasn't passing the values properly and it was just a simple syntax error! Thanks for your suggestions!
__________________
Need a vacation.
mb2000inc is offline
Reply With Quote
View Public Profile Visit mb2000inc's homepage!
 
Reply     « Reply to Web Forms Using Cookies....
 

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.12992 seconds with 13 queries