i have just open a new website in ASP.NET Visual Studio 2010(Not using mvc).
i register into the asp.net membership.
lets say :
my username is :admin.
开发者_运维技巧email :admin@mpsiteil.com..
pass:123..
the page name : admincontrol.
--
and i want that a page will showed only to user "admin".
how can i do that?
this will lock down the entire site so that only admin can view it
<authorization>
<allow users="admin" />
<deny users="*"/>
</authorization>
this will lock down a specific path
<location path="/admins_only">
<system.web>
<authorization>
<allow users="admin"/>
<deny users="*" />
</authorization>
</system.web>
</location>
Authorization in ASP.NET WebForms is easily configurable via web.config:
Setting authorization rules for a particular page or folder in web.config
精彩评论