0
我想將方法的數據傳遞給另一個方法。你能幫我嗎?在asp.net中傳遞值mvc
這裏是我的代碼:return View(model);
模型應該是通過public ActionResult ShowData(Student model)
的方法。
public ActionResult ShowData(int? ID)
{
var model = new StudentModel
{
StudentData = stdDef
};
return View(model);
}
[HttpPost]
public ActionResult ShowData(Student model) {
此鏈接可能對你有所幫助:http://stackoverflow.com/questions/4816869/mvc-pass-parameter-to-view – Tunahan
您的代碼片段似乎不完整。你可以添加缺少的休息嗎? – Marco
可能重複的[我們可以傳遞模型作爲參數在RedirectToAction?](http://stackoverflow.com/questions/22505674/can-we-pass-model-as-a-parameter-in-redirecttoaction) –