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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:46:10+00:00 2026-05-16T11:46:10+00:00

Sometimes I need to block access on a website, but I don’t want to

  • 0

Sometimes I need to block access on a website, but I don’t want to block access for administrators so they should be able to see the website and for that I guess I need to make a module.

How can I make a module like that?

This is the code I have. I just don’t know where I should place it.

var user = Membership.GetUser() as User;

if (user == null || (user != null && !user.IsAdministrator))
{
    // Block
}
  • 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-16T11:46:11+00:00Added an answer on May 16, 2026 at 11:46 am

    You can block access to a site, or portions of a site, using web.config files to configure your directories.

    As an example,

      <location path="/admin">
            <system.web>
                <authorization>
                    <deny users="*" />
                    <allow role="Administrator" />
                </authorization>
            </system.web>
        </location> 
    

    EDIT: Based on your comments above, you might be interested in the technique described at the bottom of this article for taking an application offline but still allowing administration access.

    See the docs on the location element for more examples and information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I love jqGrid but sometimes things seem more complicated than they should be. What
In the form designer, I sometimes need to see the type of a property,
Sometimes I need to make a UITableView that resembles a menu and has rows
I have my app, using functionality that is based on unity application block. Sometimes
I have a thread that returns a site's http response status, but sometimes my
Sometimes I want to edit a certain visual block of text across multiple lines.
I sometimes see reported that enterprises ban Flash. Such as here, from Adobe: Some
Sometimes I need to temporarily comment out block headings for testing purpose, e.g.: i
Sometimes the page works and you need to refresh the page to see it
Using Doxygen 1.7.4 Sometimes I'll have a block of public member functions that belong

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.