Hi All,
I have created a website using asp.net language as vb.
I have a login.aspx page after login it redirects to welcome.aspx.
While first time login, the compiler goes for page_load and it creates a session.
While am clicking submit button, i will verify the session created by me in submit_click event. now, while clicking the submit button the session is cleared. so it does not allow me to login and redirects me again to login page.
Again am giving the same credential and clicked submit button , this time it has the session value, and it allow me to welcome.aspx page.
Clearly, the session was cleared on first time postback. on second time it has the value.
Please find my code below.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Session("lid") = "123456"
End if
End Sub
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If Session("lid") <> Nothing Then
Response.Redirect("welcome.aspx")
Else
Response.Redirect("login.aspx")
Exit Sub
End If
End Sub
Kindly please help me to solve this.
Regards,
Norbert