Accessing Master page method into Child page asp.net 4.0 [Resolved]

Posted by Alokp103 under ASP.NET on 2/19/2013 | Points: 10 | Views : 7573 | Status : [Member] | Replies : 1
Hi,
i want Accessing Master page method into Child page asp.net 4.0.
kindly help me.
Thanks




Responses

Posted by: Blessyjees on: 2/19/2013 [Member] Bronze | Points: 50

Up
0
Down

Resolved
Hi,

You can try this

Assuming your master page like:

 public partial class SiteMaster : System.Web.UI.MasterPage

{
protected void Page_Load(object sender, EventArgs e)
{

}
public void TestData()
{
//write your code
}
}


Then the content page call like

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
(this.Master as SiteMaster).TestData();
}
}


Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Alokp103, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response