I have a masterpage and a content page. In the content page I have a script manager and an update panel. In the update panel I want to be able to click a button which would hit a public method on the master page to show a message. This works if I don't have an update panel on the content page but is there a way to get it to work when the button is in an update panel?
Master Page:
public void ShowMessage(string Message)
{
lblError.Text = Message;
lblError.Visible = True;
}
Content Page:
Master.ShowMessage("something");
I think it's a bit late , but for those who are looking for the solution,
Assuming your master page class like:
public MyMAsterPage: MasterPage
{
public void ShowMessage(string Message)
{
// DO SOMETHING
}
}
from your content page you can easily call any public method as follow:
(this.Master as MyMasterPage).ShowMessage("Some argument");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With