title: calling webmethod from jquery C# returning 404 error in .net aspx page
body: <p>must be missing something basic here. I am getting a 404 error calling a webmethod from jquery in an aspx page I'm running locally.</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="empJquery.aspx.cs" Inherits="webApiOracle.empJquery" %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html lang="en"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;jquery emps&lt;/title&gt;
      &lt;script src="Scripts/jquery-1.10.2.min.js"&gt;&lt;/script&gt;
      &lt;link href="../Content/bootstrap.min.css" rel="stylesheet" /&gt;
      &lt;script type="text/javascript"&gt;
  
  
          $(document).ready(function () {
              getEmployees();
  
          });
  
          function getEmployees() {
              jQuery.ajax({
                  url: 'empJquery.aspx/Test',
                  type: "POST",
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  beforeSend: function () {
                      alert("Start!!! ");
                  },
                  success: function (data) {
                      alert("a");
                  },
                  error: function (msg) { alert("Sorry!!! "); }
  
              });
          }
  
      &lt;/script&gt;
  </code></pre>
  
  <p>then in the code behind page</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using webApiOracle.Models;
  using Newtonsoft.Json;
  using Newtonsoft.Json.Linq;
  
  
  namespace webApiOracle
  {
      public partial class empJquery : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
  
          }
  
          [System.Web.Services.WebMethod]
          public static string Test()
          {
  
              return "Success";
          }
  
      }
  
  }
  </code></pre>
  
  <p>I'm getting a 404 error whenever I run I attempted changing url to  /empJquery.aspx/Test I also tried localhost/empJQuery.aspx/Test and localhost:48784/empJquery.aspx/Test  but I can't seem to get it. Do I need to add something to my web config? I'm running .net 4.5 
  thanks</p>