我如何为用户注销按钮编写代码 [英] How can i wrote code for user Logout button
本文介绍了我如何为用户注销按钮编写代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
关于
D Ramu
解决方案
假设你正在使用会员资格(如果你不是,你应该),试试:
FormsAuthentication.SignOut();
如果您正在使用会话:
Session.Abandon();
Response.Redirect( home.aspx);
或者解决方案#1也是正确的..
Session.Clear();
Session.Abandon();
Response.Redirect(Home.aspx);
Hii to all, iam developing a login page,whear user can register and can login to my page,up to this i have done, hear i want to provide a logout button for user to get back to his previous page i.e Home page, can u please send me the code for logout..thanks in advance
with regards
D Ramu
解决方案
Assuming you are using Membership (and if you aren''t, you should), try:
FormsAuthentication.SignOut();
If you''re using Session :
Session.Abandon(); Response.Redirect("home.aspx");
or else Solution #1 is correct as well..
Session.Clear();
Session.Abandon();
Response.Redirect("Home.aspx");
这篇关于我如何为用户注销按钮编写代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文