0

I have a method (non static) on master page that will be called from content page Method(static WebMethod) . E.g Master Page:

public partial class User : System.Web.UI.MasterPage
{ 
public void loadcart()
{
 //some code here that i will a div
}
}

Content Page:

public partial class Menu : System.Web.UI.Page
{
[webMethod]
public static void Order()
{
// some code here
// call Master page method from here
}
}

Order() (content Page Method) will be called from Jquery ajax and loadcar()(master page function) will be called with in Order() Function.

i need to call master page method from content page. please provide me some solution.

Any Idea please?

  • 1
    Possible duplicate of [Call Method in Master Page](https://stackoverflow.com/questions/6332889/call-method-in-master-page) – Alexander Nov 11 '17 at 18:09

1 Answers1

0

You can perform a cast of masterpage if for exemple you want to call loadcart.

           (this.Master as SiteMaster).loadcart();
Leo M
  • 123
  • 1
  • 9