Note that there are some explanatory texts on larger screens.

plurals
  1. POCreate New Asmx Page in asp.net
    primarykey
    data
    text
    <p>I am creating an asmx web service. In visual studio 2012 on the project name I right clicked and added an web service name <strong>UserDetails.asmx</strong></p> <p>Now I am trying to use the web service in the js file. like this </p> <pre><code>$.ajax({ type: "POST", url: "UserDetails.asmx/HelloWorld", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { alert('success'); }, error: function () { alert("Error"); } }); </code></pre> <p>Its showing error that <strong>POST http: //192.168.9.185/GPS/UserDetails.asmx/HelloWorld 500 (Internal Server Error)</strong></p> <p>Is there any fault in my code or I am missing something so that its showing error. My Asmx Page</p> <pre><code>&lt;%@ WebService Language="C#" CodeBehind="~/App_Code/UserDetails.cs" Class="UserDetails" %&gt; </code></pre> <p>My Code Behind </p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; /// &lt;summary&gt; /// Summary description for UserDetails /// &lt;/summary&gt; [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class UserDetails : System.Web.Services.WebService { public UserDetails () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World"; } } </code></pre>
    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.
 

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