안녕하세요, 이미지 버튼을 사용하여 모델에 값을 전달하려고했지만 아무 것도 보내지 않는 것만으로도 도움을 줄 수 있습니다.asp.net 이미지 버튼은 null 값을 보냅니다.
필자는 보통의 입력 버튼
<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;
}
}
'HttpPost' 컨트롤러 표시 actionreult – Curt