更新时间:2022-06-01 02:39:06
这是一篇适合你的文章
http://msdn.microsoft.com/en-us/library/aa478962 .aspx [ ^ ]
希望有所帮助。祝你好运。
Here is an article just for you
http://msdn.microsoft.com/en-us/library/aa478962.aspx[^]
Hope that helps. Good luck.
ASP.NET身份验证和授权 [ ^ ]
授权MSDN [ ^ ]
MSDN表单身份验证 [ ^ ]
其中***的一个是: -
无Cookie的ASP.NET表单身份验证 [ ^ ]
这些是提供授权的几个非常好的链接每页。
如果您使用的是MVC,您可以使用授权属性制作自定义属性。那肯定会有用。
希望这些对你有帮助。
谢谢。
ASP.NET authentication and authorization[^]
Authorization MSDN[^]
MSDN Forms Authentication[^]
One of the best ones is:-
Cookieless ASP.NET forms authentication[^]
These are few very good links for providing authorization to everypage.
If you are using MVC, you can take use of the Authorization Attribute making a custom one. That would surely work out.
Hope these helps you anyway.
Thanks.
First我建议使用会员资格或身份,因为你将获得所有这些开箱即用。但如果这是用于学习,则将global.asax文件添加到解决方案并使用BeginRequest事件检查用户是否已登录
First off I'd suggest using Membership or Identity as you'll get all this out of the box. But if this is for learning then add a global.asax file to the solution and use the BeginRequest event to check if the user has logged in
<%@ Application Language="C#" %>
<script runat="server">
void Application_BeginRequest(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(Session["Username"])
{
Response.Redirect("/Login.aspx")
}
}
</script>