create admin folder protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { //if(database validates user then run this code) if (FormsAuthentication.Authenticate("admin", "pass")) FormsAuthentication.RedirectFromLoginPage("admin", true); } |
<configuration>
<system.web>
<authentication mode="Forms">
<forms defaulturl="~Admin/admin.aspx" loginurl="~/default.aspx" slidingexpiration="true" timeout="20">
<credentials passwordformat="Clear">
<user name="admin" password="pass">
</user></credentials>
</forms>
</authentication>
</system.web>
<location path="admin">
<system.web>
<authorization>
<allow users="admin">
<deny users="*">
</deny></allow></authorization>
</system.web>
</location>
</configuration>
No comments:
Post a Comment