Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5960003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:45:53+00:00 2026-05-22T18:45:53+00:00

I have an ASP.NET Website. I want to restrict the Admin Folder to only

  • 0

I have an ASP.NET Website. I want to restrict the Admin Folder to only users who are of ‘Admin Role’ in this SQL Server Table: tbl_Users_Admin having columns UID, PWD, Name, Role, Status). The rest of all the root pages I want to be publicly accessible by any user.

I will not be using ASP.NET Membership.

Admin User is just given the URL (https://www.Website.com/Admin/Login.aspx).

I have two Login.aspx pages in the root as well as in the Admin Folder.

I tried to resolve it through the Forms Authentication, but I am unable to resolve it.

Few forums suggested to create two different Web.Config files (one for root folder of website and another for Admin Folder), but it seems to be an inefficient way to me.

But I have not been successful to resolve it otherwise.

Although I have tried to do this using the as follows in the web.config file at root:

  <location path="Admin">
  <system.web>
<authentication mode="Forms">
      <forms loginUrl="/Admin/Login.aspx" name=".ASPXFORMSAUTH" defaultUrl="/Admin/Login.aspx" >
      </forms>
    </authentication>
    <authorization>
    <allow roles="administrators" />
      <allow users="admin" />
      <deny users="?" />
    </authorization> 
    <sessionState mode="InProc" cookieless="false"  timeout="20">
    </sessionState>
    <customErrors defaultRedirect="~/Admin/ErrorPages/Error.aspx" mode="On">
      <error statusCode="404" redirect="~/Admin/ErrorPages/Error.aspx" />
    </customErrors>
    <compilation debug="true">
         <codeSubDirectories>
          <add directoryName="CSharp"/>
          <add directoryName="VB"/>
        </codeSubDirectories>
     </compilation>
    </system.web>
  </location>

And for the rest of the root pages (Public Pages):

<system.web>
    For rest of the root pages (Public Pages)
</system.web>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:45:53+00:00Added an answer on May 22, 2026 at 6:45 pm

    You don’t need to add the Admin folder in the web.config.

    Just add the following in the web.config under the configuration section.

    <location path="Admin">
        <system.web>
            <authorization>
                <deny users="?"/>
                <allow roles="Admin"/>
                <deny users="*"/>
            </authorization>
        </system.web>
    </location>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Asp.net website using SQL Server. I want to make a website
I have an asp.net website (SQL Server, Windows 2003, IIS 6) and I am
I have a ASP.NET website running on Server 2003 with SQL-Server as database. I
I have an ASP .NET 2.0 website connected to a SQL Server 2005 database.
I have a asp.net-mvc website with a SQL server backend (using nhibernate for OR
I have an asp.net website up and running in my production server. I want
I have a website built with ASP.NET (3.5) and want add some level of
I have an ASP.NET website containing the following <asp:UpdatePanel ID=UpdatePanel1 runat=server > <ContentTemplate> <asp:Label
I have a asp.net website folder namely Website3 inside website3 folder there is a
I am trying this. I have built asp.net website. When I publish to IIS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.