MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Whole Site Secure (Closed) (Mono Support )

Viewed 18980 time(s), 2 post(s) 2/7/2012 8:12:05 PMby HPDesign

Related topics

HPDesign

HPDesign

2/7/2012 8:12:05 PM
What is the best way to hide all content behind a login. I only want members that are logged in to be able to see any content.
This content has not been rated yet. 
15 Reputation 1 Total posts
khorvat

khorvat

2/8/2012 7:38:52 AM
Hi,

best approach to do that is to put custom authorization in the web.config e.g.
<system.web>
...
     <authorization>
          <deny users="?" />
          <allow users="*" />
      </authorization>
....
</system.web>

and then expose the pages you want by doing this
<configuration>
...
   <location path="Default.aspx">
        <system.web>
            <authorization>
                <allow users="*" />
            </authorization>
        </system.web>
    </location>
//Put other pages here
...
</configuration>

You can read more about this here "Authorization for a Web application".

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts