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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot use back Session variable outside of ascx

Status
Not open for further replies.

anitalulu

Programmer
Nov 19, 2002
23
HK
Hi

I am a beginner of ASP.NET. I have created a Login.ascx which is a login layout and check the authentication. After the user can pass his username and password, I will use a session to store an member object. However, I cannot call back the member object session outside of this login control.

What can I do? I want to get the member object outside the control page
 
Here is what I write in Login.ascx

<script runat=server>
Sub btnLogin_Click(s As Object, e As EventArgs)
Dim member As New Member()
member = member.login(txtUserName.Text,txtPassword.Text)
if member.MemberID = 0 then
lblLoginMsg.Text = "Login is invalid! Try again."
else
Session("Member") = member
end if
End Sub
</script>

But I cannot call it back outside of Login.ascx. Does anybody help?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top