hi, when session expires i want to give message and send them to my login page.for this where i have to write the code.


thank you

Recommended Answers

All 4 Replies

hi, when session expires i want to give message and send them to my login page.for this where i have to write the code.


thank you

how if like this :

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If session("UserID").ToString.Trim = "" Then
            Response.Redirect("Login.aspx")
            Exit Sub
        End If        
    End Sub
session.abandon();
session.clear();
Response.Redirect("Login.aspx");

how if like this :

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If session("UserID").ToString.Trim = "" Then
            Response.Redirect("Login.aspx")
            Exit Sub
        End If        
    End Sub

thank you,it is fine.i used it
thank you

mark the thread as solved if you have received your answer

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.