I am passing an object to an action method and that action method displays the view but it has all the proerties in the querystring and I do not want that (I have a long json string that cannot pass in url). How can I pass in a model object and not have it in the querystring? Also when you have a strong type view, Where does the object values for the Model store? Thanks for any help.
//This works fine when I am calling /controller/uploader
public ActionResult Uploader(Model model)
{
//logic
return View(model);
}
//But when I am on another method and want to call uploader it does pass the object but puts //all the data in a querystring
public void DoSomething(string val, string anotherval){
Model model = new Model();
Uploader(model);//This passes the object but when uploader page shows it has all the //model object properties in querystring and I do not want that.
return RedirectToAction("Uploader",model);//or this does the same thing
}
Try using the POST method on the html form:
This will transfer the data as Form Encoded within the request body and keep the data out of the query string.