HOW DO YOU INVOKE A WEB METHOD OF WEB SERVICE IN AJAX?

Varun Agrawal

Total Post:159

Points:795
Posted by  Varun Agrawal
AJAX 
 1914  View(s)
Ratings:
Rate this:
  1. Varun Agrawal

    Post:159

    Points:795
    How do you invoke a web method of web service in AJAX?

    In order to use a webmethod of a webservice, we need to add the reference of webservice in the <services> section of ScriptManager. Under services you have to configure the servicepath.

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    <Services>
    <asp:ServiceReference Path="..\service1.asmx" />
    </Services>
    </asp:ScriptManager>

    Inside JAvascript Use methods of this service directly like
    service1.methodname()

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!