【发布时间】:2013-02-03 18:23:14
【问题描述】:
我通常使用表单身份验证作为登录表单
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
if(FormsAuthentication.Authenticate(Login1.UserName, Login1.Password))
{
FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet);
}
}
web.config 有
<authentication mode="Forms">
<forms defaultUrl="Page.aspx">
<credentials passwordFormat="Clear">
<user name="Enter here" password="Enter here" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
但是,这不适用于 .NET 4.5。有什么更好的方法?
【问题讨论】:
-
我知道我们可以使用会员角色。试图弄清楚它是如何实现的
标签: c# asp.net asp.net-4.5