我将一个对象传递给一个操作方法,该操作方法显示视图,但它在查询字符串中具有所有属性,我不希望这样(我有一个无法在 url 中传递的长 json 字符串)。如何传入模型对象而不将其包含在查询字符串中?此外,当您有一个强类型视图时,模型的对象值存储在哪里?谢谢你的帮助。
//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
}