I am writing an ASP.NET 4 application with C#. I have a Master Page, inside of which I have the following method:
public void DisplayMessage(string input)
{
Label myMessageDisplayer = (Label)FindControl("uxMessageDisplayer");
myMessageDisplayer.Text = input;
}
Can I call this method from a content page?
At the moment, I use in Content Page this code:
Master.DisplayMessage("Item has been inserted.");
And I receive this error:
'System.Web.UI.MasterPage' does not contain a definition for 'DisplayMessage' and no extension method 'DisplayMessage' accepting a first argument of type 'System.Web.UI.MasterPage' could be found (are you missing a using directive or an assembly reference?)
Any help will be appreciated.