Handling Master Page Click Events in the Child Pages
Sometimes it is required that to access a click event of a master page button in content pages.Button present in master page is visible in every inherited child pages.But each child page needed to process some unique logic.
This is the code that defines the property in the Master Page for the Button ButtonMaster.
Code for C#:
In page Example.Master
In it's cs page set property
public Button ButtonClick
{
get{
return Button1;
}
}
In child pages
child.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
//masterPage button click event defined in child pasge
Example mp = (Example)Page.Master;
mp.ButtonClick.Click += new EventHandler(ButtonTest_Click);
}
void ButtonTest_Click(object sender, EventArgs e)
{
//throw new System.Exception("The method or operation is not implemented.");
// put the logic here
}
This is how to handle master click event in child pages.

is it possible to initiate master page button with child page method