Running a MasterPage method from within default.aspx?

  • Thread starter Thread starter Steve Kershaw
  • Start date Start date
S

Steve Kershaw

Hi,

I have an ASP.NET application with a MasterPage that has a method
defined as public. Now I want to run this MasterPage method from
INSIDE the default.aspx page.

I know there has to be a way of doing this!

Anybody know?

Thanks
Steve
 
Easy:
Just define your master page in the page (HTML) declaration section as
follows:
<%@ masterType TypeName="MyMasterClassName" %>
and then inside your code behind you will be able to write:
Master.MyMasterPublicMethod
 
Back
Top