Friday, December 28, 2012

reach out to the master page in a web forms ASP.NET project

This is one way to go fishing for a method in the master page from the page using it:

char foo = (Page.Master as Bar).ContentSeparator

 
 

The master page itself would start out like so:

public partial class Bar : System.Web.UI.MasterPage
{
   protected void Page_Init(object sender, EventArgs e)
   {

No comments:

Post a Comment