Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

return json object after form submitted completed

$
0
0

Hi,

I want to return Json object after form submit.

If I have below case:

@using (Html.BeginForm("Upload","Home",FormMethod.Post,new{id = "myForm", enctype = "multipart/form-data"}))
{
<input type="file" name="files" /><input type="submit" /> } public ActionResult Upload(IEnumerable<HttpPostedFileBase> files){ return Json(new { result = "success", errors = "Fail" }, JsonRequestBehavior.AllowGet); } // How can I read this object in View again or pass this json object as parameter to javascript function, Note: I did not call the action "Upload" by ajax. ex:
$.ajax({ url: 'Url.Action("Upload","Home"), data:... etc success:function(data){ // If I do this way, I can read object. But I want to call function after submit completed. // I tried attributes > onsubmit / AjaxOptions OnComplete ... but nothing work. } }); Any assist please.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>