DooDoo
DooDoo

Reputation: 13487

How to call static method in another page from Master Page

I have a page that contains a static method like this:

public partial class _Default : System.Web.UI.Page
{
    [WebMethod(EnableSession = true)]
    public static string Aware()
    {
        return DateTime.Now.ToString();
    }
}

How I can call this method from a Master Page?

Upvotes: 0

Views: 1000

Answers (1)

Massimiliano Peluso
Massimiliano Peluso

Reputation: 26737

_Default.Aware() as for any other static method

EX:

 public partial class About : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            _Default.Aware();
        }
    }

Upvotes: 2

Related Questions