开发者

how do i redirect after logout in asp.net

开发者 https://www.devze.com 2023-04-05 11:51 出处:网络
I\'ve placed login status control on a page, and placed under LogoutP开发者_Python百科ageUrl to Default.aspx.

I've placed login status control on a page, and placed under LogoutP开发者_Python百科ageUrl to Default.aspx.

However, after I logout it redirects me to

...default.aspx?ReturnUrl= some stuff

So, it does not redirect me directly to default.aspx. How do I force 'real' redirect ?

Thanks

EDIT:, solved: this in linkbutton:

        Session.Abandon()
        FormsAuthentication.SignOut()
        Response.Redirect("~/Default.aspx")


Place linkbutton and this code onCLick()

Session.Abandon()
FormsAuthentication.SignOut()
Response.Redirect("~/Default.aspx")
0

精彩评论

暂无评论...
验证码 换一张
取 消