Loosing Session variables...

L

Lars Netzel

This is basic Session handling but it's not working.

On a Page1.aspx I have this code:
-----------------------------------
If TextBox1.Text = "admin" And TextBox2.Text = "Admin01" Then

Session("admin") = "True"

Response.Redirect("Page2.aspx")

End If

---------------------------------

On Page2.aspx I have this code
------------------------------------------------
Response.Write(Session("admin"))
------------------------------------------------

I get nothing... and if I debug, the Session("admin"´) is Nothing...

Do I need to do something to turn session handlign on?

best regards/
Lars
 
C

Chris Hyde

Lars said:
This is basic Session handling but it's not working.

On a Page1.aspx I have this code:
-----------------------------------
If TextBox1.Text = "admin" And TextBox2.Text = "Admin01" Then

Session("admin") = "True"

Response.Redirect("Page2.aspx")

End If

Response.Redirect (default) is destructive to Sessions...use the
overloaded Redirect, and pass "false" as the second parameter.

HTH...
Chris
 
L

Lars Netzel

Overloaded? What do you mean?

/Lars


Chris Hyde said:
Response.Redirect (default) is destructive to Sessions...use the
overloaded Redirect, and pass "false" as the second parameter.

HTH...
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top