在一个登录页面上有一个login控件组成(有自定义过程),再加一个注册用户的连接,现在的问题是点击注册后没有连接到注册页面.可能与web.config有关
<authentication mode="Forms">
<forms name="myAuthentication" loginUrl="Main.aspx" protection="All" timeout="60" path="/"></forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
login控件的Authenticate过程如下:
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
string user=Login1.UserName.ToString();
string pwd=Login1.Password.ToString();
if(Membership.ValidateUser(user,pwd))
{
Encrypt encry = new Encrypt();
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(Server.MapPath("Fis.xml"));
System.Xml.XmlNode root = doc.DocumentElement;
string dwm = root.InnerText.ToString();
doc = null;
dwm = encry.Decode(dwm);
Fis_SysinfoDao fis = new Fis_SysinfoDao();
if (dwm.Equals(fis.getDwm()))
e.Authenticated = true;
else
{
JScript.Alert("非法用户!");
e.Authenticated = false;
}
}
else
e.Authenticated=false;
}
请问如何解决?
<authentication mode="Forms">
<forms name="myAuthentication" loginUrl="Main.aspx" protection="All" timeout="60" path="/"></forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
login控件的Authenticate过程如下:
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
string user=Login1.UserName.ToString();
string pwd=Login1.Password.ToString();
if(Membership.ValidateUser(user,pwd))
{
Encrypt encry = new Encrypt();
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(Server.MapPath("Fis.xml"));
System.Xml.XmlNode root = doc.DocumentElement;
string dwm = root.InnerText.ToString();
doc = null;
dwm = encry.Decode(dwm);
Fis_SysinfoDao fis = new Fis_SysinfoDao();
if (dwm.Equals(fis.getDwm()))
e.Authenticated = true;
else
{
JScript.Alert("非法用户!");
e.Authenticated = false;
}
}
else
e.Authenticated=false;
}
请问如何解决?
登陆时到有可能跟web.config有关!!
我不写WEB,但我猜你那个应该是连接有问题!!!
注册是个连接,而你的连接跳转写的有错!
<authorization>
<deny users="?"/>
</authorization>
<deny users="?"/>
</authorization>
你否定了连到注册页面的权限