Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trouble reusing Session value

Status
Not open for further replies.

VisualGuy

Programmer
May 27, 2003
162
US
If I reload my page I lose the original value of the session variable. So the first time I sign-on to the page, I can view the user. However, if I reload the page, the session variable "WelcomeUserNew" gets wiped-out. Any ideas?

Protected Sub form1_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Init

' Writing to session variable
If Request.QueryString("WelcomeUser") <> "" Then
Session("WelcomeUserNew") = Request.QueryString("WelcomeUser")
End If

If Session("WelcomeUserNew") IsNot Nothing Then
Welcome.Text = Session("WelcomeUserNew").ToString()
End If


End Sub
 
how about
Code:
 If Page.IsPostback Then 
    End //or the equivalent of return;
 End If
 Welcome.Text = Request.QueryString("WelcomeUser")

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top