CodeVerge.Net Beta


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




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 11/3/2005 1:19:11 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 4 Views: 146 Favorited: 0 Favorite
5 Items, 1 Pages 1 |< << Go >> >|
drdexter33
Asp.Net User
Exposing ASP.Net Menu Properties in a MasterPage11/3/2005 1:19:11 PM

0

Hello there...

--------------------------------------------------------------------------------------------------------------------------------------
SCENARIO:
--------------------------------------------------------------------------------------------------------------------------------------
1). I have an <asp:Menu> control in a MasterPage.

2). The data in the <asp:Menu> is using a web.sitemap as its datasource.

3). There are several items in the <asp:Menu> that I would like to disable based on the NT authentication
and whether or not the authenticated user requesting the page belongs to a certain ROLES group.

4). Since I do NOT have access to the USER OBJECT in the MasterPage (although I'm too sure why..),
I guess the best way to make this work is to force the user to enter through, say DEFAULT.ASPX,
and check the User.IsInRole(), and then disable the <asp:Menu> sections accordingly.
--------------------------------------------------------------------------------------------------------------------------------------
QUESTION:
--------------------------------------------------------------------------------------------------------------------------------------
Can I expose the <asp:Menu> in the MasterPage so that based on the identity of the user, I can hide certain items in
this <asp:Menu> in the application entry page (in this case, DEFAULT.ASPX)?



Thanks in advance.

God Bless..

Doug Dexter

John 3:16


Fredrik N
Asp.Net User
Re: Exposing ASP.Net Menu Properties in a MasterPage11/3/2005 2:09:34 PM

0

Take a look at this post on my blog.

If you can't specify the Role to the web.sitemap file, you can instead create your own SiteMap provider that will only return the nodes the current user are allowed to see. Here is a post on my blog about how you can create a SiteMap provider.

If you want to access the menu control from a content page you can expose the control by using a property.

To access the User object from your MastePage, you use the Context class:

Context.User.IsInRole(...)

/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
drdexter33
Asp.Net User
Re: Exposing ASP.Net Menu Properties in a MasterPage11/3/2005 2:43:18 PM

0

Pretty cool!

Thanks!
-------------------------------------------------------------------------------------
QuestionSleep [S]:
-------------------------------------------------------------------------------------
1.   Can you have more than one location path?
      I mean to say, What do you do if you have several
      pages to hide?
      How do you code it in the Web.Config file?
2.   Does the location path actually reside in the Web.Config file?
3.   I'm using impersonation. Is that a problem?
-------------------------------------------------------------------------------------
      For example; here's how I've modified my Web.Config file:
-------------------------------------------------------------------------------------
<location path="LoggedInUserRoles.aspx">
   <identity impersonate="true" userName="acct\username" password="pwd"/>
      <authorization>
         <allow users="acct\devGrp"/>
         <allow roles="Dev" />
      </authorization>
</location>
-------------------------------------------------------------------------------------
Although this is making the compiler complain:
-------------------------------------------------------------------------------------
<location> sections are allowed only within <configuration> sections.

Thanks again!

doug



Fredrik N
Asp.Net User
Re: Exposing ASP.Net Menu Properties in a MasterPage11/3/2005 4:06:21 PM

0

You can add several <location> element to the web.config. The section must be inside of the <configuration> element.
/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
drdexter33
Asp.Net User
Re: Exposing ASP.Net Menu Properties in a MasterPage11/3/2005 5:34:05 PM

0

That works!

You're the greatest...

thanks.

God Bless..

doug



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


Free Download:

Books:
Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter Kit Authors: David Sussman, Alex Homer, Pages: 312, Published: 2006
PROFESSIONAL ASP.NET 3.5 IN C# AND VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1728, Published: 2008
ASP.Net 2.0 MVP hacks and tips Authors: David Yack, Joe Mayo, Scott Hanselman, Fredrik Normen, Dan Wahlin, J. Ambrose Little, Jonathan Goodyear, Pages: 400, Published: 2006
ASP.NET 2.0 Instant Results Authors: Imar Spaanjaars, Paul Wilton, Shawn Livermore, Pages: 456, Published: 2006
Professional Asp.net 3.5 Sp1 Edition: In C# and Vb Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1856, Published: 2009

Web:
ASP.NET 2.0: Referencing Master Page Members ASP NET 2 0 Training Referencing Master Page Members In this tutorial you will learn about reference Master Page Mebers add property to Master Page expose ...
Exposed Property in Master Page is not accessible - ASP.NET Forums Hello Friends i ve created a basic Master Page wid a public exposed property and i am trying to access it in the content page it is giving ...
MasterPage not exposing properties?! - ASP.NET Forums Hey guys, before we received the final release of VS 2005 and ASP.NET 2.0 I used to be able to access the public properties on my Masterpage ...
Problem exposing master page properties... : properties, master ... Zone: Programming for ASP.NET. Tags: properties, master, page, exposing. Sign Up Now! Solution Provided By: raterus. Participating Experts: 3 ...
Setting Properties of User Control On Master Page - bytes Usually by exposing them as Master page properties - as your user control is " internal" to the master page, ... the user control builds a menu to for users to navigate through the website. ... ... news:5gm0f1F3g9nuvU1@mid.individual.net... Quote: ...

Common SSL Certificate Problem - ng.asp-net-forum.dotnetnuke Common SSL Certificate Problem, > ROOT > NEWSGROUP > Asp.Net Forum ... exposing asp.net menu properties in a masterpage ...
StyleSheetTheme cannot be set programatically? - ng.asp-net-forum ... The StyleSheetTheme property can not be set, please override the ... through the property getter in the page rather than exposing a .... I'm using master pages but you don't seem to be able to override the master page StyleSheetTheme. ... studio???? problem with asp.net menu control - leaving a . ...
change the SiteMapProvider - ng.asp-net-forum ... asp.net navigation menu doesnot work in firefox · applying theme on run time · publicly expose specific controls in masterpage (can it be done?) ...
Core Localization File Not Found - ng.asp-net-forum.dotnetnuke UsersOnline Core Localization File Not Found - ASP.NET Forums Heres the log file entry. ... exposing properties of master page · menu ...
Programmatically adding controls to asp:content - ng.asp-net-forum ... wizard control validation solutions · exposing asp.net menu properties in a masterpage · not able to select the master page while creating a new page ...












master page issues with sub folders

help : user master page with asp:formparameter , save only blank data to database msaccess

menu control does not render correctly in a master page

web.config pages theme not working after publish

"highlight" current node in custom menu control?

programmatic change of menu.selectedvalue

styling asp.net 2.0 menu control

how to access properties of the parant panel in the contentplaceholder?

create user wizard problem

css frindly adapters - how to apply skin?

treeview and navigationurl

is there a way to maintain a common theme?

include file statement in an aspx page

how to refresh datalist control in master page from nested page

wierd asp.net 2.0 menu behavior in ie7

get selected value for sqldatasource select parameter located in content page from listbox located in master page

login view master page

bc30456: 'theme' is not a member of 'asp.default_aspx'.

load different web.sitemap file based on the user

menu control alignment is 1 pixel off

how to change style for staticmenuitem level 1

how to leave the white spaces at left and right of the web without affecting the contents in the middle?

external stylesheet on a content page

styling text box scroll bars

menu control rendering

css - bottom,middle please

treeview image

master page with css problem

nested wizard control: having sub-steps in a 2.0 wizard control

variable height floating page

 
Search This Site:

 
  Privacy | Contact Us
All Times Are GMT