Hi Nitin,
If you want to accomplished it, you could define a base class BasePage that herits from Page, then make your content page inherits from it and override relate methods.
for example :
BasePsge .cs
public class BasePage :Page
{
public virtual string SayHello()
{
return "This is basepage information!";
}
}
the code behind of master page:
BasePage currentPage = null;
protected void Page_Load(object sender, EventArgs e)
{
currentPage = Page as BasePage;
}
protected void CallContentMethod_Click(object sender, EventArgs e)
{
if (currentPage != null)
{
welcomeMessage.Text = currentPage.SayHello();
}
}
the code behind of content page
default.cs
public partial class Template_Default : BasePage
public override string SayHello()
{
return "This content page information!";
}
Hope it helps!!