John,
This does not make any sense to me. I tried your code and it works fine on
my end. the session has the correct info picked from the second page.
Response.Redirect(Request.QueryString("PageID"),fa lse)
the Boolean parameter, indicates whether execution of the current page
should terminate.
I hope you are right and explain why it works that way or someone else can
explain this.
Thank you,
Lit
"John Wright" <ri***********@hotmail.comwrote in message
news:Oa**************@TK2MSFTNGP05.phx.gbl...
Fixed it. It has to deal with the Response.Redirct. I needed to overload
it so it reads:
Response.Redirect(Request.QueryString("PageID"),fa lse)
This takes care of it.
"Lit" <sq**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>where are you putting the code Session("Login") = row.Item(1).ToString
why a for loop for executing only once?
are you within the same domain?
are you within asp.net always?
Lit
"John Wright" <ri***********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>>>I use the following code to set a session variable for people I have
authenticated to my site:
For Each row As DataRow In foundRow
Session("Login") = row.Item(1).ToString
Exit For
Next
Response.Redirect(Request.QueryString("PageID" ))
The Session("Login") get set just fine, but when I do the redirect the
page that loads checks for the following:
If Session("Login") = "" OrElse IsNothing(Session("Login")) Then
Response.Redirect("Login.aspx?PageID=" & Request.Path)
Else
Label1.Text &= " " & Session("Login").ToString
End If
When I check the session variable here, it is empty. Does anyone know
why?
John