0
我將一個對象傳遞給一個操作方法,並且該操作方法顯示該視圖,但它擁有查詢字符串中的所有協議,並且我不想要這樣json字符串不能通過url)。我怎樣才能傳入模型對象,而不是在查詢字符串中?另外,當您擁有強大的類型視圖時,模型商店的對象值在哪裏?謝謝你的幫助。將對象傳遞給mvc中的操作方法在查詢字符串中放置屬性
//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
}