实现Logout事件时,页面验证事件在My表单中提升,并停止Firing Logout Method
当我在ServerClick()
上调用Logout Method时,需要停止页面验证事件 <li><a href="" runat="server" id="logout" class="trigger" onserverclick="logout_ServerClick"><span>Logout</span></a></li>
我的代码:
protected void logout_ServerClick(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Session.Abandon();
Session.Clear();
Session.RemoveAll();
Response.Redirect("Login.aspx");
}
答案 0 :(得分:0)
使用CausesValidation =&#34; False&#34;
<asp:LinkButton id="logout" runat="server" Text="logout" CausesValidation="False"> </asp:LinkButton>