?
Solved

Hide menu nodes based on roles

Posted on 2008-10-17
3
Medium Priority
?
1,388 Views
Last Modified: 2012-05-05
Hello, I have a menu control on a page that is populate with the following site map:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="~/default.aspx " title="Home"  description="Home">
  <siteMapNode url="~/About.aspx" title="About"  description="About"/>
        <siteMapNode url="~/Contact.aspx" title="Contact"  description="Contact"/>
      <siteMapNode url="~/Join.aspx" title="Join"  description="Join"/>
 <siteMapNode url="~/Bondsman/Default.aspx" title="Bondsman" >
  </siteMapNode>
<siteMapNode url="~/BountyHunter/Default.aspx" title="Bounty Hunter" >
   </siteMapNode>
    </siteMapNode>
  </siteMap>

The bondsman and bountyhunter nodes go to sections of the site that only those roles are allowed to go. I want to hide these nodes until the user logs in. Then based on their particular row show the nodes.

I add the following in the web.config when using active directory and this works great. How is it accomplished with the asp.net membership provider?????

This is my location entries the the web.config.
 </location>
  <!--This security setting is for access to the bondsman folder-->
  <location path="Bondsman">
    <system.web>
      <authorization>
        <allow roles="Admin,Bondsman"/>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>

  <!--This security setting is for access to the bountyhunter folder-->
  <location path="BountyHunter">
    <system.web>
      <authorization>
        <allow roles="Admin,BountyHunter"/>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>




0
Comment
Question by:gogetsome
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
tree33 earned 2000 total points
ID: 22742670
0
 

Author Comment

by:gogetsome
ID: 22742965
Thanks for the link. I'm trying to make it work but in vb. I'm in the process of converting the class but having issues with ths sub

   Public Sub Init(ByVal context As System.Web.HttpApplication) Implements IHttpModule.Init

            context.AuthenticateRequest += New EventHandler(Me.AuthenticateRequest)
        End Sub

This is the error:

Error      1      'Public Event AuthenticateRequest(sender As Object, e As System.EventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.      
0
 

Author Closing Comment

by:gogetsome
ID: 31507222
Hey, I suppose that would work. but I also found that this does too:

   
     
     
   



The point are still your as your link was a viable solution.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question