我有一个页面可以动态生成任意数量的div。 div里面有一堆用户信息,带有文本区域和一个关闭记录的按钮。 请看看在HTML这里(我已经去掉了所有的 东西 不需要回答我的任务):处理ASP.NET MVC3表单中多个按钮的提示/建议?
<form action="/Recruiter" method="post">
<span id="1" class="underline" >Click Here</span>
<div id="notes_1" style="display: none;">
<textarea cols="30" id="PostBodyText" name="PostBodyText" rows="10"></textarea>
</div>
<input id="btnCloseOut" type="submit" name="Command" value="Close out" title="Close out."/>
<input type="hidden" name="recruiterQueueId" value="2" />
<input type= "hidden" name="queueRecordId" value="1" />
<span id="2" class="underline" >Click Here</span>
<div id="notes_2" style="display: none;">
<textarea cols="30" id="PostBodyText" name="PostBodyText" rows="10"></textarea>
</div>
<input id="btnCloseOut" type="submit" name="Command" value="Close out" title="Close out."/>
<input type="hidden" name="recruiterQueueId" value="2" />
<input type="hidden" name="queueRecordId" value="2" />
<span id="3" class="underline" >Click Here</span>
<div id="notes_3" style="display: none;">
<textarea cols="30" id="PostBodyText" name="PostBodyText" rows="10"></textarea>
</div>
<input id="btnCloseOut" type="submit" name="Command" value="Close out" title="Close out."/>
<input type="hidden" name="recruiterQueueId" value="2" />
<input type="hidden" name="queueRecordId" value="3" />
最后这里是一个被张贴到看起来像什么控制器片:
[HttpPost]
public ActionResult Index(int recruiterQueueId, int queueRecordId, string postBodyText)
{
CloseOutQueueRecordResponse response =
checkInService.CloseOutQueueRecordRequest
(
new CloseOutQueueRecordRequest()
{
RecruiterQueueId = recruiterQueueId,
QueueRecordId = queueRecordId,
CloseOutNotes = postBodyText
}
);
// details ommitted...
}
问题是总会出现,无论我打哪个按钮从第一个div的信息。我不是在抱怨,这是它应该做的。
我只是在寻找创意/建议,就如何发布信息,我想
OR
...我WSA的想法是一个按钮,里面的其他东西使用@ Html.ActionLink。 ...这几乎为我工作。我能得到相应的ID来控制,但我还没有能够提取文本区域的内容,在这种情况下...
任何提示/建议吗?
我不明白你的问题是什么。 – RedFilter 2011-06-07 20:03:24