CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 6/1/2007 4:23:31 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 76 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
uaebelle
Asp.Net User
Hide menu items on page load from a master page6/1/2007 4:23:31 PM

0/0

Hello everyone Big Smile

It's my first post over here and I'm hoping to get a little tiny bit of help Embarrassed

I'm developing a web application using VB.NET + ASP.NET.

I have two user roles: Administrator + Normal User.

The Admin and the normal user are each directed to different home pages.

I have added a menu with sub menus to the master page.

How can I hide menu items from the master page depending on the user role?

I think adding a master page for each user role is difficult because how can I tell the application to use which master page Confused?

You help will be greatly appreciated Cool

 

bmains
Asp.Net User
Re: Hide menu items on page load from a master page6/1/2007 5:55:37 PM

0/0

Hey,

What is the menu based on?  Do you have a web.sitemap and are using a sitemap provider?


Brian

"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
uaebelle
Asp.Net User
Re: Hide menu items on page load from a master page6/1/2007 6:21:44 PM

0/0

No I'm not.

I read a few articles saying that I shoud create a sitemap.

Is that necessary?

Or is it possible to do that without a site map?

Thanks :)

bmains
Asp.Net User
Re: Hide menu items on page load from a master page6/4/2007 11:47:35 AM

0/0

Hey,

It is possible with both, with or without.  I've even used an XML file as well.  With the web.sitemap, if you set securityTrimmingEnabled to true, you can allow only a certain role to see that node, as such:  http://geekswithblogs.net/azamsharp/archive/2006/05/02/77018.aspx

That sounds like everything you want to do.  You could also programmatically set the visible attribute to false for items you don't want people to see.

HTH.


Brian

"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
Jeevi
Asp.Net User
Re: Hide menu items on page load from a master page6/6/2007 2:51:42 AM

0/0

hi,

  u can also try using two menu controls, one for Admin and the other for Normal users.

so, after the user logged in u can set the Session variable like Session("ROLE")="admin" / Session("ROLE")="normal", then u need to add the following in ur Master Page_Load Event,

If Session("ROLE")="admin" Then
   MenuCtl1.Visible = True
   MenuCtl2.Visible = False
ElseIf Session("ROLE")="normal" Then
   MenuCtl2.Visible = True
   MenuCtl1.Visible = False 
EndIf

hope this helps.

 

5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Mastering InDesign CS3 for Print Design and Production: for print design and production Authors: Pariah S. Burke, Pages: 492, Published: 2007
Adobe InDesign CS3 Bible Authors: Galen Gruman, Pages: 988, Published: 2007
InDesign CS3 For Dummies Authors: Galen Gruman, Pages: 414, Published: 2007
InDesign CS2 For Dummies Authors: Barbara Assadi, Galen Gruman, Pages: 386, Published: 2005
InDesign CS for Macintosh and Windows: Visual QuickStart Guide Authors: Sandee Cohen, Pages: 576, Published: 2004
Master Visually Dreamweaver CS3 and Flash CS3 Professional: Dreamweaver Cs3 and Flash Cs3 Professional Authors: Sherry Kinkoph, Sherry Kinkoph Gunter, Janet Valade, Pages: 665, Published: 2007
Master Visually Creating Web Pages: Creating Web Pages Authors: Joe Kraynak, Pages: 421, Published: 2004
Adobe PageMaker 6.5: Classroom in a Book Authors: Adobe Systems, Pages: 318, Published: 1997

Web:
CodeProject: Using Menu and Sitemap with Master page. Free source ... Aug 13, 2006 ... For this you can add the below code in the master page’s load event .... And also, I have more than 6 menu items and for each menu item in ...
Hiding a Menu Item on a MasterPage? - VBForums What I want to do is hide the menu item that was used to call the specific page, i.e.. If my menu choices on the master page are: ...
SharePoint - Hiding Menu Items from the Edit Control Block ... Oct 24, 2008 ... But if you want to hide some of the menu items, you cannot do so by ... Save the custom.master page and upload it to the master pages ...
KWizCom SharePoint CRM Blog: Hide "New" document menu item in ... Here is how you can remove sub menu items under New menu: .... A master merge was started. ... Variations Menu - switching between a page variati. ...
Master Pages, Themes and Navigation Controls - ASP.NET Forums Page 3 of 619 (12371 items) < Previous 1 2 3 4 5 Next > ... Last » ... how can clear text of textbox of master page on page load by privious... by ankitsahu ...
Element-Enhancing Javascript in ASP.NET Master Pages - Stack Overflow ALWAYS set your master page id in page load (this. ... How to Dynamically add menu items to master page in ASP.NET 3.5 MVC app ...
problems with referencing control from master page on content page referencing a menu control that is placed on a master page from a content ... Dynamically load webcontrol · Hide Menu Items Based On Roles ...
1. Test On MasterPage drag the menu control into menuwrapper div. B. Set data source to SiteMap ... In Page Load …. Select which menu to show/hide ...
Master Pages, Themes and Navigation Controls on Forums - ASP.NET ... How Can I Hide a menu Item in a masterPage - 5 new posts ... database(i made that in the page load event). i am also having 10 content pages ...
Hide menu item - ng.asp-net-forum ... There is no Visible property for menu items so this can't be done ... down the menu to the photo item, the page will load but with no photo. ...




Search This Site:










how to add additional portals?

installing ibuyspy portal

display random photos

tabs don't inherit portal look and feel in new module postback

how was portalcfg.xml created?

help: image picture not showing??? path issue??

set role permissions on individual modules to control visibility vb.net version

where is the db located

the following device adapter set is already registered: 'portalhtmldeviceadapters' error - when running mobiledefault.aspx

read more.... file creation

running the project requires setting an initial web page, how to do this?

sqlview 2.2.0 - free module from dnnstuff

add existing module

can't get custom error messages to work

configuration error - with v1.1 installed.

error inside admin

assemblyinfo file + change name

changing welcome email to welcome name

request.applicationpath

moving the portal

uploading module

can not get it to find my server

creating a second row of tabs when a specific tab is selected

web farm support: "indexoutofrangeexception: filename"

path issue

problem opening mobiledefault.aspx

let's go off topic and wish everyone of the ibs users ...

xsl problems

adding a new class to the psk

error when installing asp.net portal using prtl.exe

  Privacy | Contact Us
All Times Are GMT