0

Hello my fellow DaniWebers!

I have a question for you!

I have an ASP.Net website that I am currently working on. The problem that I am having is that I want to render the Master page's menu differently for the user types. Here is the catch. I can't use roles, only user names.

I have stared by creating different SiteMaps in the project, and Adding Multiple providers in the Web.config.

The menu is on the Master Page, and is bound with a SiteMapSource. This is a horizontal menu, and not a treeview. (Couple of Google results solved for a treeview.)

The question being; How do I bind the menu programmaticly on load by username? (AD Driven)

As far as I can tell:

User.Identity.Name

Is null for the master page, but I can pass the username in from the default page. (or the login page)

Thanks for any ideas/help!

I posted this in VB.NET because of the code backend, or should I flag to move the post to ASP.NET?

Edited by Reverend Jim: wrong forum

4
Contributors
4
Replies
27
Views
4 Years
Discussion Span
Last Post by Begginnerdev
0

i think you need to post on asp.net part....this is vb.net.

your problem i think User.Identity.Name still can use on master page, because i think i alredy make it on my project before.

0

For you to use User.Identity.Name, the website needs to have anonymous authentication disabled and Windows authentication enabled (probably why you are getting null). You can use User.Identity.Name in the master page as well as aspx pages that link to a master page.

Edited by JorgeM

0

I actually ended up using a cookie that is stored upon log-on.

The problem persists with the site map. I can't figure out how to bind multiple sitemaps to multiple binding sources.

I have three sitemaps:

Basic User - A
Basic User - B
Administrator

Only the administrator sitemap binds, but that is due to it being the original sitemap.
The other two are modified versions of the original.

I am wanting to only render menu items that are relevant to the user.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.