Call Method in Master Page

前端 未结 4 583
梦如初夏
梦如初夏 2020-12-01 23:36

I have a public method in my asp.net Master Page. Is it possible to call this from a content page and if so what are the steps/syntax?

4条回答
  •  旧时难觅i
    2020-12-02 00:14

    You can simply do like...

    MasterPageClassName MasterPage = (MasterPageClassName)Page.Master;
    MasterPage.MasterMethod();
    

    Check for Details ACCESS A METHOD IN A MASTER PAGE WITH CODE-BEHIND

提交回复
热议问题