Early Binding Master Page

Last post 09-19-2008 3:33 PM by DMW. 2 replies.

Sort Posts:

  • Early Binding Master Page

    09-19-2008, 2:26 PM
    • Member
      341 point Member
    • unosinu
    • Member since 12-17-2005, 7:03 AM
    • Posts 145

    Hello,

    Anyone knows how to access Methods implemented in Master Page from Content Page?

    Thanks

  • Re: Early Binding Master Page

    09-19-2008, 3:32 PM
    Answer
    • Member
      341 point Member
    • unosinu
    • Member since 12-17-2005, 7:03 AM
    • Posts 145

    I got the ans. I just needed to create a new instance of the masterpage class.

    Thanks anyway

  • Re: Early Binding Master Page

    09-19-2008, 3:33 PM
    Answer
    • Star
      13,979 point Star
    • DMW
    • Member since 09-04-2002, 2:25 AM
    • Posts 2,006
    • Moderator

    Use the MasterPage property on the content page. Cast this to the appropriate reference type (your master page's class). Call the methods.

    You can also use a directive in the page, and a setting in the <pages> element to specify what type your master page is.

    For a truly professional solution, define an interface that your master page implements and cast the MasterPage reference to that type, before calling the methods. That way, you can interchange master pages without having to edit the content page code.

    Regards

    Dave
Page 1 of 1 (3 items)