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 39743 time(s), 2 post(s) 07.02.2012 20:12:05by HPDesign

Related topics

HPDesign

HPDesign

07.02.2012 20:12:05
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.
Dieser Inhalt wurde noch nicht bewertet. 
15 Reputation 1 Total posts
khorvat

khorvat

08.02.2012 07:38:52
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
Dieser Inhalt wurde noch nicht bewertet. 
15993 Reputation 2214 Total posts