web config - How to apply the asp.net authorization in two different folders? -
i have 2 folders in asp.net website namely vendors , admin
i want when user access of page inside admin folder redirects admin/login.aspx until login ....
i want when user access of page inside vendors folder redirects vendors/login.aspx until login ....
how using web.config authorization ....
you need have web.config files inside admin , vendors folder separately. inside these web.config files declare <formsauthentication>
elements independently. global web.config should contain no <formsauthentication>
element.
edit:
provide xml snippet below, implementing formsauthentication not task recommend beginner. first should read , understand process involved in implementing @ least basic formsauthentication model. being said, relevant web.config entry under <system.web>
section:
<authentication mode="forms"> <forms loginurl="~/vendors/login.aspx" protection="all" timeout="30" name=".aspxauth" requiressl="false" slidingexpiration="false" defaulturl="~/vendors/default.aspx" cookieless="usedeviceprofile"/> </authentication>
Comments
Post a Comment