Questions about Setting Authentication for independent pages in ASP. NET

Source: Internet
Author: User
ArticleDirectory
  •  

We all know that identity authentication requirements for all pages are implemented using the following methods:
<Authentication mode = "forms">
<Forms name = ". onlinework" loginurl = "logoin. aspx" Protection = "all" timeout = "60"/>
</Authentication>
<Authorization>
<Deny users = "? "/>
</Authorization>

In the document "setting individual pages for authentication when setting form authentication does not require authentication", DDL points out that to configure a page independently, authentication is not required, however, the way to keep other pages requiring identity authentication is later on the web. add the corresponding page configuration in <configuration> of config. In fact, if there are more pages, this configuration may be a little troublesome.

We have encountered similar problems and found ASP. net has a feature that allows independent web under any directory. config file, and the Web. the Config File takes precedence over the web in the root directory. config file. In this way, we only need to store all the pages that do not require identity authentication in the directory and configure the web. the config file does not require identity authentication, and the page/directory that requires Identity Authentication coexist.

The opposite is true: the main directory does not require identity authentication. Some pages require identity authentication. Put the pages that require Identity Authentication in a directory, and then configure the Web. config of this directory to require identity authentication.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.