Skip to content Skip to sidebar Skip to footer

Send Data With Jquery To An Mvc Controller

Solution 2:

Solution 3:

Declare your action as a POST

[HttpPost]
public ActionResult _EditDescription(string docId, string filename, string description)

Create an invisible HTML form:

<form action="@Url.Content("~/OrderDetail/_EditDescription/")" method="post" name="editDescriptionForm">
   <inputtype="hidden" name="docId" />
   <inputtype="hidden" name="fileName" />
   <inputtype="hidden" name="description" />
</form>

Fill out the form and submit it with JS:

functioneditDescription(docId, fileName, description) {
    document.editDescriptionForm.docId = docId;
    ...

    document.editDescriptionForm.submit();
}

Post a Comment for "Send Data With Jquery To An Mvc Controller"