Note that there are some explanatory texts on larger screens.

plurals
  1. POWeb Service method name is not valid
    primarykey
    data
    text
    <p>I get the following error "Web Service method name is not valid" when i try to call webmethod from javascript </p> <blockquote> <p>System.InvalidOperationException: SaveBOAT Web Service method name is not valid. at System.Web.Services.Protocols.HttpServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp; abortProcessing)</p> </blockquote> <p><strong>HTML Code :</strong></p> <pre><code>&lt;asp:LinkButton runat="server" ID="lnkAddBoat" OnClientClick="javascript:AddMyBoat(); return false;"&gt;&lt;/asp:LinkButton&gt; </code></pre> <p><strong>JS Code :</strong></p> <pre><code>function AddMyBoat() { var b = document.getElementById('HdnControlId').value; jQuery.ajax({ type: "GET", url: "/AllService.asmx/SaveBOAT", data: { Pid: b }, contentType: "application/text", dataType: "text", success: function(dd) { alert('Success' + dd); }, error: function(dd) { alert('There is error' + dd.responseText); } }); } </code></pre> <p><strong>C# Code (Web method in AllService.asmx file)</strong></p> <pre><code>[WebMethod] public static string SaveBOAT(int Pid) { // My Code is here //I can put anythng here SessionManager.MemberID = Pid; return ""; } </code></pre> <p>I tried all solutions found on Stack Overflow and ASP.NET site.but none of them worked for me.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload