Click here to Skip to main content
15,903,175 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more: (untagged)
Hey everyone,
Can we allow/deny access to a particular page to a particular user.
Please dont bother about the reason why this functionality is required. Question is, can we configure our application this way.

I have been asked this question many a times in interviews
And still Im not sure this can be done or not.

Any help will be appreciated.

Thanks
Posted

1 solution

If you want to specify page or full folder that don't need to be authenticated, use <location> tag in web.config.

For example

<location path="yourFoldername">
   <system.web>
      <authorization>
         <allow users="*" />
      </authorization>
   </system.web>
</location>


The <b>path </b>attribute can be used to identify a specific file or child directory to which unique configuration settings apply.
 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900