1.跳转用 FormsAuthentication.RedirectFromLoginPage("qidongadmin.aspx", false); //指向default.aspx 不可以
但是在下面加入一个 Response.Redirect("qidongadmin.aspx");就可以,有人说是bug
还是什么原因,高寿说一下2.后台退出登陆,删除cookie信息,要加入FormsAuthentication.SignOut()
但是前台是这么写的
<A onclick="javascript:window.open('../default.aspx','','');parent.window.opener=null;parent.window.close();"
href="#">退出</A>
现在想在后台用代码写在一起如何写?也就是把上面的转化成后台代码,来执行
但是在下面加入一个 Response.Redirect("qidongadmin.aspx");就可以,有人说是bug
还是什么原因,高寿说一下2.后台退出登陆,删除cookie信息,要加入FormsAuthentication.SignOut()
但是前台是这么写的
<A onclick="javascript:window.open('../default.aspx','','');parent.window.opener=null;parent.window.close();"
href="#">退出</A>
现在想在后台用代码写在一起如何写?也就是把上面的转化成后台代码,来执行
2 使用linkbutton,click事件
FormsAuthentication.SignOut();
Response.Write("<script>window.open('../default.aspx','','');parent.window.opener=null;parent.window.close();");
string returnUrl=Request.QueryString["ReturnUrl"];
if(returnUrl==null)
returnUrl="downLoad\\download.aspx";
Response.Redirect(returnUrl);
这样写就没问题了
FormsAuthentication.RedirectFromLoginPage("qidongadmin.aspx", false); //指向default.aspx 不可以
但是在下面加入一个 Response.Redirect("qidongadmin.aspx");就可以究竟是什么原因呢?
Page_Load()
{
ExitButton.Attribute.Add("onclick","javascript:window.open('../default.aspx','','');parent.window.opener=null;parent.window.close();");
}用此方法可在后台代码中添加任何客户端Javascript代码
将经过身份验证的用户重定向回最初请求的 URL 或默认 URL。
public static void RedirectFromLoginPage (
string userName,
bool createPersistentCookie
)
所以他不会跳转至qidongadmin.aspx
而Response.Redirect("qidongadmin.aspx");就可以