web config - How to apply the asp.net authorization in two different folders? -


enter image description here

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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -