Hi,
To enable an .asmx Web service to be called from client script in an ASP.NET Web page, you first add a ScriptManager control to the page. You reference the Web service by adding an asp:ServiceReference child element to the ScriptManager control and setting its path attribute to point to the Web service. The ServiceReference
object instructs ASP.NET 2.0 AJAX Extensions to generate a JavaScript
proxy class for calling the specified Web service from client script.
The
following example shows how to enable a Web service named
SimpleWebService.asmx to be called from script in an ASP.NET Web page.
<asp:ScriptManager runat="server" ID="scriptManager">
<Services>
<asp:ServiceReference
path="~/WebServices/SimpleWebService.asmx" />
</Services>
</asp:ScriptManager>
The ServiceReference
object can reference a Web service only in the same domain. The Web
service path can be relative, application relative, domain relative, or
absolute. For absolute paths, you must make sure that the path is in
the same domain.
If you have further questions, let me know!
Best Regards,