こんにちは、画像ボタンを使用してモデルに値を渡そうとしていますが、何も送信しないだけでは誰も助けられないと言っています。
通常の入力ボタンで動作するようになりました
<input type="submit" name="Vote" value="6" />
画像ではありません。
<input type="image" src="..urlpath" name="Vote" value="6"/>
<button type="submit" name="Vote" value="6"> 6 <img src="...urlpath" /></button>
あなたが私を助けることができれば、それは素晴らしいことです
コントローラ
public ActionResult PlanVote()
{
return View();
}
[HttpPost]
public ActionResult PlanVote(int vote)
{
PlanModel myModel = PlanModel.Instance;
myModel.Vote(vote);
if (PlanModel.Instance.currentstate == PlanState.displaying)
{
return RedirectToAction("Index", "Plan");
}
else
{
return RedirectToAction("Waiting", "Plan");
}
}
モデル
public void Vote(int Votes)
{
ivote.Add(Votes);
if (countVotes >= iCount)
{
currentstate = PlanState.displaying;
}
}