【发布时间】:2013-03-07 11:51:24
【问题描述】:
我正在开发一个小型网站,它将成为大型网站的一部分。它没有自己的身份验证和数据库,但我想对它使用表单身份验证。我在 web.config 中添加了几行
<authentication mode="Forms">
<forms loginUrl="Login.aspx" timeout="2880" defaultUrl="Default.aspx" />
</authentication>
<authorization>
<deny users="?"/>
</authorization>
在代码中,我需要在其中包含什么 ????????地方?目前,它只会停留在登录页面,不会重定向到默认页面。顺便说一句,登录页面并不是真正的登录页面,它只是一个将从大网站调用并检查用户是否被授权的页面。
If everything is fine Then
?????????????????
FormsAuthentication.SetAuthCookie("UserName", True)
FormsAuthentication.RedirectFromLoginPage("UserName", True)
Else
'show error
End If
【问题讨论】:
标签: asp.net aspnetdb form-authentication