データを持つモデルがあります。 私はオンボタンだけのフォームを作成していますが、私はそのモデルのデータを使用していません。 ボタンを押すと、HTTPPOSTメソッドが正しく実行されますが、モデルは完全に空です。ポストのMVC3空モデル
HTML:
@model ViewModels.RequestDeletionViewObject
@using (Html.BeginForm())
{
<input type="submit" value="submit"/>
}
RequestDeletionViewObject:
public class RequestDeletionViewObject : ViewModelBase
{
public TreeGridData NodeFilespacesData { get; set; }
public Dictionary<long, string> EmailList{ get; set; }
}
コントローラー:
public ActionResult RequestDel()
{
return View(_businessLogic.GetData());
}
[HttpPost]
public ActionResult RequestDel(RequestDeletionViewObject model)
{
return View(_businessLogic.GetData());
}
私は、他の多くの場所で同様のことをしてくれました。それはそこで働いていましたが、ここでは何が分かりませんか? ありがとう
私は確かではありませんが、あなたはそれを "生きて"保つためにビューの値を渡す必要はありませんか? – mattematico