Access the page content method from the MasterPage method

Possible duplicate:
How to call the function of the content page from the main page

I need to access the Content Page Method from the Master page Event. How can i do this?

I saw this on stackoverflow but couldn't find out how to use it - LINK

(cphPage.Page as PageBase).YourMethod();

Can you explain this?

Content Page:

public partial class Call_Center_Main : System.Web.UI.Page
{
    Page_Load(object sender, EventArgs e)
    {
    }

    public void MenuClick(string ClkMenu)
    { 
     // Some Code
    }
}


MasterPage:

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

    protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
    {
      //How Can I call MenuClick method from Content Page from Here  ???
    }

How can I call a method MenuClickfrom a content page from Menu1_MenuItemClickin a masterpage ???

+1
source share

All Articles