How to access a user control in a masterpage from a content page?
问题 Lets say that I have a header user control in a master page, and want to change a property of the user control depending on what content page is loaded inside of the master page. How might I go about this? Thanks! 回答1: 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=""> OR <%@ MasterType TypeName=""%> tag to your aspx page. In the VirtualPath