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 8336547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:01:27+00:00 2026-06-09T04:01:27+00:00

I have set up member folders in c# asp.net webforms before to only allow

  • 0

I have set up member folders in c# asp.net webforms before to only allow certain users and to redirect if the user is not authenticated. I am wondering is this possible / how would I implement the authentication based on weather a Session variable is present(filled with a value) or not authenticate if the Session is null.

I was hoping that something like this would be possible similar to how you can set permissions in we.config for entire folder.

  • 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-06-09T04:01:28+00:00Added an answer on June 9, 2026 at 4:01 am

    It can be done with help of standart asp.net features. I will try to advice one possible solution for it. First you need to setup “web form authentication” ASP.NET Authentication, you should modify your web.config.

    <system.web>
       <authentication mode="Forms">
          <forms name="Custom" loginUrl="/login.aspx" />       
       </authentication>
    </system.web>
    

    Then you need to specify members locations in the web.config also ASP.NET Authorization.

    <location path="folders/memberN">
       <system.web>
          <authorization>
             <allow roles="memberN"/>
             <deny users="*"/>
          </authorization>
       </system.web>
    </location>
    

    This will allow all users in group “memberN” to work under “folders/memberN” path.

    Next we need to add membership and role providers to your web.config. Membership and role providerse configured based on sql server provider.

    <configuration>
        <connectionStrings>
            <add name="SqlServices" 
                 connectionString="Data Source=MySqlServer;Integrated Security=SSPI;Initial 
                 Catalog=aspnetdb;" />
        </connectionStrings>
        <system.web>
            <roleManager defaultProvider="SqlProvider" 
              enabled="true"
              cacheRolesInCookie="true"
              cookieName=".ASPROLES"
              cookieTimeout="30"
              cookiePath="/">
              <providers>
                <add
                  name="SqlProvider"
                  type="System.Web.Security.SqlRoleProvider"
                  connectionStringName="SqlServices" 
                  applicationName="SampleApplication" />
              </providers>
            </roleManager>
            <membership 
                 defaultProvider="SqlProvider"
                 userIsOnlineTimeWindow="20">
                 <providers>
                    <remove name="AspNetSqlProvider" />
                    <add name="SqlProvider"
                        type="System.Web.Security.SqlMembershipProvider"
                        connectionStringName="SqlServices"
                        applicationName="/" />
                </providers>
            </membership>
        </system.web>
    </configuration>
    

    Finnaly we need to create special tabels in the database (more details).

    %WINDOWS%\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -S <server> -E -d <database> -A all
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In routes.rb I have set up match member/:permalink => accounts#profile when the user's url
When you set caret on member/method in code you have all its occurrences highlighted,
I have a set of divs in the following structure: <div id=team> <div class=member>
I have a database with three tables, user, update and error. I have set
I have a set of search criterias in this form: member | value |
I have member variables in my custom UIViewController that are defined as 'assign' (not
I have set the eclipse java formatter to wrap lines that exceed 120 characters
I have set a background on the data-role=page element like so <div data-role=page style=background:
I have set up Eclipse Indigo to do line debugging with CFEclipse over port
I have set up upload_max_filesize and post_max_size to 32Mb in php.ini. I am using

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.