title: Ajax Post method not working for user defined function
body: <p><code>UpdateModule</code> is a function used for update module details. It's not a view page.</p>
  
  <p>When click on update, it returns 500 (internal server error) or  404 error</p>
  
  <p>please help to fix it </p>
  
  <pre><code>$.ajax({
          type: 'POST',
          url: '@Url.Action("ETM_PRODUCTS","UpdateModule")',
  
          //contentType: 'application/json',
          datatype: JSON,
  
          data: { 'ModuleID': ModuleID, 'ModuleName': ModuleName, 'ModuleDescription': ModuleDescription },
          success: function (data) {
              if (data == true) {
                  alert("Updated Successfully");
              }
          },
          error: function (msg) {
               alert("Error")
          },
      });
  </code></pre>
  
  <p>c#</p>
  
  <pre><code>public JsonResult UpdateModule(int ModuleID,string ModuleName,string ModuleDescription) {
          bool status = true;
         PROD_MODULE tabledata = db.PROD_MODULE.Where(x =&gt; x.ETM_MODULE_ID == ModuleID)
                             .FirstOrDefault();
  
          tabledata.NAME = ModuleName;
          tabledata.DESCRIPTION = ModuleDescription;
                             db.SaveChanges();
  
          return Json ( status, JsonRequestBehavior.AllowGet );
      }
  </code></pre>