Access UserControl Label id into master page in Asp.net

Last Reply on Jan 26, 2016 04:26 AM By Shashikant

Posted on Jan 26, 2016 04:26 AM

How to use web user control label id into masterpage? as its not working 

You are viewing reply posted by: Shashikant on Jan 26, 2016 04:26 AM.
Posted on Jan 26, 2016 04:26 AM

Hi,

You can use two methods. The first is by using Page.Master.FindControl('controlID'). Then you can cast it to the type of your user control. The second method is by adding a <%@ MasterType VirtualPath="" TypeName=""%> tag to your aspx page. In the VirtualPath add the virtual path to the master page, and the class in the TypeName. You can then access everything with intellisense.