>>Hi All,
>>
>>Ok, another master page question. I know I have seen some info on this somewhere but can't remember where. I have a master page that has links to other pages on it. If I am on one of those pages, I want to either hide the link or disable it since we are already on that page. I am not sure if I can get to the master page from the content page or not, but also can I detect which content page is loaded from the master? How can I do this?
>>Thanks
>>Tim
>
>Yes, you can get to the master page from the content page. Use the Page.Master reference. You may need to cast it if you need to access any custom properties or methods you've defined.
>
>
>MyMasterPage master = Page.Master as MyMasterPage;
>
>if (master != null)
>{
>}
>
>
>You can also use FindControl to find a specific (not nested) control on the master page:
>
>
>Label label = Page.Master.FindControl("lblSomething") as Label;
>
>
>The same is true for accessing content from the master page that may be contained in a content page (eg. use FindControl on this.ContentPlaceHolder1, or whatever it's named). You can also just look at the Request.Path (or any of the other various Request paths) to determine which page you're on.
I think I will try to use the latter approach of putting code in the Master to find the which page it is on and disable the controls that are also in the master.
Thanks Paul
Tim
Timothy Bryan