I have an ASP.NET MVC3 application, and when the user clicks my anchor tag, I want to send 3 pieces of data to the action:
<a onclick='editDescription(<#= DocID,FileName,Description #>)'></a>
This is javascript to call my action:
function editDescription(docId,fileName,description) { var url = "@Url.Content("~/OrderDetail/_EditDescription/")" + docId+'/'+ fileName + '/' + description;
My action:
public ActionResult _EditDescription(string id,string filename, string descritpion)
The parts I'm worried about are FileName and Description, because they can be loooooong, and I don't want the url to display like this:
http://localhost/OrderDetail/_EditDescription/123/some long filename.pdf/this is a long description for the name
How can I send my data to my action without sending it as query strings? Thanks
BoundForGlory
source share