Menu optons - "logged in" vrs "not logged in"

Jun 6, 2008 at 5:18 PM
First. Great job sofar! what a nice clean look and feel. I love the ajax popup windows etc.

What I am having a problem understanding at the moment is how the Menu change is triggered based on logged in state.

The menu seemes to be driven by an XML file via the SiteMapSource Control on the Site.Master or the Auction.master file, However I have not been able to figure out how it filters the options based on logged in status.

In the past I have used the events like tha pageload, and or controls like the logginView to do this, but I can't seem to find any code that controls this behaviour.  Really cool, but how/????

TIA


Rob
Jul 9, 2008 at 12:23 PM
Yes very nice project.
About the menu: Seems that menu items are displayed according to current user's roles. For example if we want to get rid of "register" item when some user is logged in we need to move the page in the newly created folder /Register and update all links to point to new location of the register page. After that we need to add web.config file in /Register folder to protect register.aspx page from visitors that are logged in, so the web.config file placed there should read:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <authorization>
      <allow users="?" />
      <deny users="*" />
    </authorization>
  </system.web>
</configuration>

Authorization section states that access to all pages in the folder where this web.config file is places (/Registration/) is grantet to annonimus users only.

Alternatively you can add following lines in <configuration> section in the main web.config file if you don't want to move register.aspx page and update all links that point to it:

<location path="register.aspx">
    <system.web>
      <authorization>
        <allow users="?" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>

/Alex


Jul 9, 2008 at 3:42 PM
Thank Alex.!