我有一个框架页,框架页内又载入了两个页面,一个是A页,一个是B页.我要实现的是,A页中有个登录按钮,点击后,B页出现登录项. 然后,在B页内输入用户名,密码.如果验证通过,就让A页中的登录铵钮上的文字变成注销.同时A页中显示用户名.并且,B页跳转到Default.aspx页...现在点击A页中的登录按钮后使B页出现登录项.已经实现.但是验证通过后.A页中 "登录铵钮上的文字变成注销.同时A页中显示用户名.并且,B页跳转到Default.aspx页..." 实现不了.. 登录成功后的代码如下:-------------------------------------------
base.CurrentUser = custData;
// 下面这句JAVASCRIP代码好像没执行一样
Response.Write("<script language=javascript>window.top.PageA.location = 'A.aspx'; </script>");
if(url != null && url != string.Empty)
{
Response.Redirect(url,true);
}
else
{
FormsAuthentication.RedirectFromLoginPage("*", false);
} ---------------------------------
请大虾们帮忙... 着急...
base.CurrentUser = custData;
// 下面这句JAVASCRIP代码好像没执行一样
Response.Write("<script language=javascript>window.top.PageA.location = 'A.aspx'; </script>");
if(url != null && url != string.Empty)
{
Response.Redirect(url,true);
}
else
{
FormsAuthentication.RedirectFromLoginPage("*", false);
} ---------------------------------
请大虾们帮忙... 着急...
if(login)
{
System.Web.Security.FormsAuthentication.RedirectFromLoginPage(userName, false);
}Default页
private bool isLogon = false;
if(System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
{
this.button1.Text = "注销" + System.Web.HttpContext.Current.User.Identity.Name + "的登录";
this.isLogon = true;
}
else
{
this.button1.Text = "登录";
}void button1_click(object sender, EventArgs e)
{
if(this.isLogon)
{
System.Web.Security.FormsAuthentication.SignOut();
}
else
{
string url = "Login.aspx?ReturnUrl=" + System.Web.HttpUtility.UrlEncode(@"Default.aspx");
Response.Redirect(url);
}
}