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

  • Home
  • SEARCH
  • 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 8776927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:10:30+00:00 2026-06-13T19:10:30+00:00

I have a VS 2008 web application running on IIS 6. In the web.Config

  • 0

I have a VS 2008 web application running on IIS 6. In the web.Config wile there is a section like this:

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

I have a user control which is used on numerous pages in various locations to provide content. I want that control to filter content based on the location of the page it is on. For example, if the control is on an aspx page located in the “public” folder as specified in the sample above, I would like certain information to not be displayed.

How can I accomplish this in my codebehind? It may also be that this web.Config setting is completely irrelevant, to this question, you decide. VB or C# are fine, I can translate.

Perhaps something like this? If path.Contains("public") Then filterResults()

Thanks! 🙂

  • 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-13T19:10:31+00:00Added an answer on June 13, 2026 at 7:10 pm

    I would add a public property to the user control called “Mode” OR “ContextUrl” or something to that effect. Then branch logic off of that property. You should also have a ‘default’ set of logic.

    Ultimately, having this behavior dictated by a public property is something that is more intuitive and testable to the “developer” who is interacting with your user control as opposed to something hidden in the controls implementation.

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

Sidebar

Related Questions

this is kind of tricky: I have an C# web application running always on
I have couple web applications on my windows server 2008 r2. Running on IIS
I'm running win server 2008 R2 with IIS 7.5 I have an application under
I have an ASP classic web application running on windows 2008 r2 server is
I have created a web application using Visualstudio 2008 using C# on my computer.
I have an asp.net web application written in C# using a SQL Server 2008
I have made a web application using Visual studio 2008. till now it was
I have an asp.net application running on my development machine (windows 7 ultimate, IIS
I have a scenario wherein my ASP.NET MVC 3 web application hosted in IIS
I'm getting the following error in my ASP.NET web application in IIS when running

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.