那位能给我说说form验证呀。不是很懂。 那位能给我说说form验证呀。不是很懂。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <a href = "http://www.cnblogs.com/csjackie/archive/2008/11/03/1325760.html?login=1" ></a> <a href = "进去看吧" >http://www.cnblogs.com/csjackie/archive/2008/11/03/1325760.html?login=1</a> 就是Form提交数据。然后判断啊。 Form验证是什么挖? 我只会JS 验证 然后传到后台 在后台在验证一次````````求理论帝`````` 晕。。ASP.NET Forms 身份验证----少了个s1. 在 web.config 中设置 Forms 身份验证相关参数。2. 创建登录页。登录页中的操作包括:1. 验证用户名和密码是否正确。2. 创建身份验证票证对象。3. 将身份验证票证对象加密成字符串,写入 Cookies。4. 重定向到原始请求 URL。<?xml version="1.0"?><configuration> <system.web> <compilation debug="true"/> <authentication mode="Forms"> <forms loginUrl="~/logon.aspx" name="MyAuthForm"> <credentials passwordFormat="Clear"> <user name="username" password="password"/> </credentials> </forms> </authentication> <authorization> <deny users="?"/> </authorization> </system.web></configuration><%@ Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Button1_Click(object sender, EventArgs e) { if (FormsAuthentication.Authenticate(this.txtUsername.Text, this.txtPassword.Text)) FormsAuthentication.RedirectFromLoginPage(this.txtUsername.Text, true); else Response.Write("用户名或密码错误!"); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>登录页</title></head><body> <form id="form1" runat="server"> <div> Username: <asp:TextBox ID="txtUsername" runat="server" Width="100px" Text="username"></asp:TextBox><br /> Password: <asp:TextBox ID="txtPassword" runat="server" Width="100px" Text="password"></asp:TextBox><br /> <asp:Button ID="Button1" runat="server" Text="Sign In" OnClick="Button1_Click" /> </div> </form></body></html>这个就是简单的例子。更详细信息,请参考 MSDN 文档。ms-help://MS.MSDNQTR.v80.chs/MS.MSDN.v80/MS.NETDEVFX.v20.chs/dv_ASPNETgenref/html/8163b8b5-ea6c-46c8-b5a9-c4c3de31c0b3.htm FORM认证 关于样式的问题 文件上传 UpdateProgress显示问题 一个弹出对话框的返回问题!!请教 在线等!! adp.net中如何采集信息??? 求,打开查询到的所有表的所有列的方法 )=********讨论一下ASP.NET+VB.NET的前途********=(跟贴有分 大家快看看自己的可用分,可能会有意想不到的结果。 using System.Data.ADO;的问题 如何让LinkButton相应回车键 textbox获取值为空 rdlc 报表布局效果问题 jquery 缺少对象 vs2008
晕。。ASP.NET Forms 身份验证----少了个s1. 在 web.config 中设置 Forms 身份验证相关参数。
2. 创建登录页。登录页中的操作包括:1. 验证用户名和密码是否正确。
2. 创建身份验证票证对象。
3. 将身份验证票证对象加密成字符串,写入 Cookies。
4. 重定向到原始请求 URL。
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true"/>
<authentication mode="Forms">
<forms loginUrl="~/logon.aspx" name="MyAuthForm">
<credentials passwordFormat="Clear">
<user name="username" password="password"/>
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</configuration>
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
if (FormsAuthentication.Authenticate(this.txtUsername.Text, this.txtPassword.Text))
FormsAuthentication.RedirectFromLoginPage(this.txtUsername.Text, true);
else
Response.Write("用户名或密码错误!");
}
</script><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>登录页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Username: <asp:TextBox ID="txtUsername" runat="server" Width="100px" Text="username"></asp:TextBox><br />
Password: <asp:TextBox ID="txtPassword" runat="server" Width="100px" Text="password"></asp:TextBox><br />
<asp:Button ID="Button1" runat="server" Text="Sign In" OnClick="Button1_Click" />
</div>
</form>
</body>
</html>这个就是简单的例子。更详细信息,请参考 MSDN 文档。
ms-help://MS.MSDNQTR.v80.chs/MS.MSDN.v80/MS.NETDEVFX.v20.chs/dv_ASPNETgenref/html/8163b8b5-ea6c-46c8-b5a9-c4c3de31c0b3.htm