give me coding for logout in asp.net

Posted by reddysankark-13471 under ASP.NET on 4/27/2012 | Points: 10 | Views : 6139 | Status : [Member] | Replies : 3
hi,

give me coding for logout without using logout control

sankarreddy


Responses

Posted by: Dotnetrajanikanth on: 4/27/2012 [Member] Starter | Points: 25

Up
0
Down
Private Sub LbtLogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbtLogout.Click


'Kill the user session.
Session.Abandon()

'Signing out of the website.
FormsAuthentication.SignOut()

'Redirect to the home page
Response.Redirect(FormsAuthentication.DefaultUrl)

End Sub


____________
www.flickr.com/photos/psdesigner/

reddysankark-13471, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Oswaldlily on: 4/27/2012 [Member] Starter | Points: 25

Up
0
Down
just inside logout button control include this:


Session["Username"]="";
Response.Redirect("../login.aspx");


If yu logout,this ll redirect to yur loginpage back..

reddysankark-13471, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Somasundaram on: 4/27/2012 [Member] Starter | Points: 25

Up
0
Down
Session.Abandon()
Response.Redirect("Login.aspx");

reddysankark-13471, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response