Simple Postback using Session Variable

S

Scott

I'm trying to set a session variable after displaying a form, then capture
the Session variable on postback. For some reason, the below code always
returns the form, not the "Step 2" results part.

What am I doing wrong? It's on a local network server, not on the web if
that matters.

<%
'* Step 2: Display results
'**********************************************
If Session("PageAction") = "view2" Then
Response.Write "Results"



'* Step 1: Display form
'**********************************************
Else
%>

<form name="myform" method="post" action="postback.asp">

<%
Session.Contents.RemoveAll()
Session("PageAction") = "view2"
%>
<input type="submit" value="View Results" name="submit1">

<%
End If
%>
 
A

Aaron Bertrand - MVP

For some reason, your session variables are being discarded. See
http://www.aspfaq.com/2157 for some possible reasons (the most common reason
is that you are developing locally or on an intranet, and there is an
underscore in the name of the server you are connecting to).
 
S

Scott

it was the _

ip address fixed it. thanks.

Aaron Bertrand - MVP said:
For some reason, your session variables are being discarded. See
http://www.aspfaq.com/2157 for some possible reasons (the most common reason
is that you are developing locally or on an intranet, and there is an
underscore in the name of the server you are connecting to).
 
A

alejandro

-----Original Message-----
For some reason, your session variables are being discarded. See
http://www.aspfaq.com/2157 for some possible reasons (the most common reason
is that you are developing locally or on an intranet, and there is an
underscore in the name of the server you are connecting to).









.

mate, I was really pissed that my SESSION variables were
not working!!! it turns out on the IIS, DEFAULT WEB SITE
PROPERTIES, HOME DIRECTORY, CONFIGURATION, MAPPINGS I
unchecked the 'CACHE ISAPI APPLICATIONS OPTION' and that
was f@cking me up !!!
 
M

Mark Schupp

Probably because you were convenient and when you spend a bunch of time
looking for a programming solution to a simple configuration problem you
want to yell at somebody (other than yourself)!

--
Mark Schupp
--
Head of Development
Integrity eLearning
Online Learning Solutions Provider
(e-mail address removed)
http://www.ielearning.com
714.637.9480 x17
 

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
474,266
Messages
2,571,072
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top