Login Membership .NET

吃可爱长大的小学妹 提交于 2019-12-06 06:57:01

Alter Web.config in application root to read:

<authentication mode="forms">
   <forms loginUrl="Login.aspx" defaultUrl="/" />
</authentication>
<authorization>
   <deny users="?" />
   <allow users="*" />
</authorization>

Side note: Obviously, ASP.NET can only protect the requests that are handed down to ASP.NET engine. By default, it cannot enforce the security on static resources in IIS classic mode. In that case, to control access to static resources, they should be explicitly mapped to the ASP.NET ISAPI DLL in the IIS configuration.

More info about Authorization here: ASP.NET Authorization.

Forms Authentication explained

Here's a sample from a web.config

<forms loginUrl="Login.aspx"
       protection="All"
       timeout="30"
       name=".ASPXAUTH" 
       path="/"
       requireSSL="false"
       slidingExpiration="true"
       defaultUrl="default.aspx"
       cookieless="UseDeviceProfile"
       enableCrossAppRedirects="false" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!