Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

call web methods from ajax in episerver



I have search page template which have web method. So i create in admin mode search page (

So how I can call from ajax her web method?

PS: In standart web from I can call web method like this

  type: "POST",
  url: "PageName.aspx/MethodName",
  data: "{}",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  success: function(msg) {
    // Do something interesting here.
which url I must use for call web method in Epriserve page templete
Apr 13, 2013 13:57

Maybe someone else may have an idea or practice of how to work with ajax call in episerver?

because I still can not call my web method...

Apr 14, 2013 13:33

Doesn´t /search/mymethod work? You also need the WebMethodAttribute decorated on your method. If that does´t work make sure ASP.NET Ajax is working correctly by creating a simple web forms .aspx that inherits from Page with a simple method with the WebMethodAttribute that you can call like any other .aspx (/mytest.aspx/mymethod).


Apr 14, 2013 20:59

So it doesnt work because my url is not correct.. on search page mysite/search/ and url in ajax is


So when I clicked url is mysite/search/Views/Pages/SearchPageTemplate.aspx/MyMethod it wrong, correct url is


I need instance + "Views/Pages/SearchPageTemplate.aspx/MyMethod". Maybe You can prompt how to get instance ?

Thanks in advance.

Apr 14, 2013 22:16
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.