PDA

View Full Version : Session Problem - How to use session?


mattboy_slim
05-11-2006, 11:48 PM
I have a page where a user enters information into a form. I would like, after the user submits the form, to take them to a page where they can confirm that the information is correct. The first page (absencerequest.aspx) would submit the form to the database, which is done. However, on the second page (confirm_absence.aspx), I would like to display the information, and ask the user if the information is correct. However, I am at a complete loss as to how to complete this.

Here is the code for the submit page: http://www.rdi1.com/sheldon_request.aspx

What I need to know exactly, is how do I put the f_ID into a session variable (which would be the autonumber, or primary key in my Access database) and pull that on the second page? If I can pull that in a session variable or even better, as the URL parameter, then I can handle it from there.

Thanks in advance,
Matt

Nischumacher
05-12-2006, 02:21 PM
FoLLoW THe LiNKS To See HoW SeSSioN VaRiaBLeS (http://www.w3schools.com/asp/asp_sessions.asp) and QueRYSTRiNG (http://www.w3schools.com/ASP/coll_querystring.asp) WorK...
HoPe iT HeLPS.

mattboy_slim
05-12-2006, 05:56 PM
Well here they are setting a session variable staticly:
<%
Session("username")="Donald Duck"
Session("age")=50
%>
But I need to do it dynamically, and that web site doesn't give me much information on that.

Thanks,
Matt

Nischumacher
05-13-2006, 09:36 AM
Do NoT SuBMiT THe VaLue iN THe DaTaBaSe oN THe FiRST PaGe... Do THiS oN THe SeCoND PaGe iNSTeaD... aFTeR THe uSeR CoNFiRMS THaT THe iNFoRMaTioN WaS FiNe.

uSe Request.Form To GeT THe VaLueS FRoM FiRST PaGe To SeCoND PaGe.

SiNCe YouR LiNK (http://www.rdi1.com/sheldon_request.aspx) iS NoT WoRKiNG...
i WiLL aSSuMe THaT THe FoRM oN PaGe HaS THe FieLDS NaMeD "field01", "field02", "field03" aND So oN.
aFTeR You SuBMiT, THeSe VaLueS CaN Be aCCeSSeD LiKe...
Dim fld_1 = Request.Form("field01")
Dim fld_2 = Request.Form("field02")
Dim fld_3 = Request.Form("field03")

Malith
05-18-2006, 12:58 PM
This is the way handling session


Session["name"] = txtname.text;
Session["Age"] = txtage.text;

like that u can use the session .

cheers

malith