ASP.NET: Call function in MasterPage through UserControl
问题 Calling a function from the MasterPage in a Page is quite straigt forward but how do I call it for a UserControl: Adding <%@ MasterType VirtualPath="~/MasterPage.master" %> , doesn't work on UserControls. So this.Page.Master.MyFunction() fails :( 回答1: Niels, Leverage reflection (as suggested by JDunkerley) is one approach to the problem. Another you might consider is implementing an interface: Create an interface that includes your method. Implement the interface in your master page From your