- Where Developers Learn, Share, & Build Careers


I have a VS The 2008 web application is running on IIS 6. In the web Conif Willy is a section like this:

  & lt; Location Path = "Public" & gt; & Lt; System.web & gt; & Lt; Authority & gt; & Lt; Allow users = "?" / & Gt; & Lt; Allow users = "*" /> & Lt; / Authorization & gt; & Lt; /system.web> & Lt; / Location & gt;   

I have a user control that is used on many pages of different places to provide content. I want control for filtering the content based on the location of that page which is current. For example, if there is a control over the ASPX page located in the "Public" folder specified in the above sample, then I should not see some information.

How can I do this in my code? It may also be that the web The config setting is completely irrelevant, for this question, you decide. VB or C # OK, I can translate.

Maybe something like this? If Path Includes ("public") filter result then ()

thanks! I will add a public property in user control called "Mode" or "Context Url" or that effect.

Finally, this behavior is being determined by public property, which is more intuitive and is testable for "developer" who is communicating with your user control as in the control implementation Contrary to hidden things

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -