Monday, March 26, 2012

Setting Selected states for buttons and links based on web.sitemap

Hello, I am new to .NET20... I am using a web.sitemap XML file for site navigation and have used it for the breadcrumb easily. I have written a Master Page that includes a USER Control which represents the top navigation of the site. The user control is just a table with images.. I want to use the sitemappath control to figure out which button image to set to the SELECTED state for the requested page. In the past I would write out a client side Javascript file which modified the src of the image id to the correct image based on parsing the requested URL...I don't want to do it that way here. I would like to understand how to modify the IMAGEURL in my USERCONTROL from the child page. I am having trouble figuring out how to reference the ID of the USERCONTROL inside my MasterPage and to make matters more complicated I am using LOGINVIEW to control which TopNav buttons an Anonymous user sees vs. an Authenticated user sees.

Any help is appreciated...

Hi,

Based on my understanding, you want to get and update the value of control, which on the master page, from the content page. If I have misunderstood you, please feel free to let me know.

We can use FindControl method to locate specific controls on the master page and update the values by your requirements(such as requested URL). For more information, seeWorking with ASP.NET Master Pages Programmatically.


I hope this helps.

0 comments:

Post a Comment