**MVC View function** //studentName may be very long function GetFile(){ var searchCondiction = { studentName: $("#studentName").val(), startDate: $("#UploadYear").val(), }; location.href = "@Url.Action("GetFile", "Student")?" + $.param(searchCondiction ); } **MVC Controller function** public ActionResult GetFile(string studentName,DateTime startDate) { //Product file according to studentName and startDate ... //Return file Return File(Server.MapPath("~/App_Data/UserA/a.png"),"imge/png"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)