【发布时间】:2010-03-06 11:04:07
【问题描述】:
我目前正在 MVC2 中开发应用程序 我想在我的应用程序中使用多个表单标签 在我看来 我创建了一个具有删除选项的表,我正在通过 Post for Individual Delete 执行此选项,因此我为每个按钮创建了表单标签。 我还希望用户提供删除多条记录的选项,因此我为它们提供了复选框。此表单应具有复选框的所有值和所有值。 所以表单会像这样渲染
对于每个删除按钮
<form action="/Home/MutipleDelete" method="post">
<input class="button " name="Compare" type="submit" value="Mutipledelete" style="margin-right:132px;" />
<input id="chk1" name="chk1" type="checkbox" value="true" />
<form action="/Home/Delete" method="post">
<input type="submit" class="submitLink" value="member1" />
<input type="hidden" name="hfmem1" id="hfmem1" value="1" />
</form>
<input id="chk2" name="chk2" type="checkbox" value="true" />
<form action="/Home/Delete" method="post">
<input type="submit" class="submitLink" value="member2" />
<input type="hidden" name="hfmem2" id="hfmem2" value="2" />
</form>
</form>
以下不工作。但是如果我编写了表单以这种方式呈现的代码
<form action="/Home/MutipleDelete" method="post">
<input class="button " name="Compare" type="submit" value="Mutipledelete" style="margin-right:132px;" />
</form>
<input id="chk1" name="chk1" type="checkbox" value="true" />
<form action="/Home/Delete" method="post">
<input type="submit" class="submitLink" value="member1" />
<input type="hidden" name="hfmem1" id="hfmem1" value="1" />
</form>
<input id="chk2" name="chk2" type="checkbox" value="true" />
<form action="/Home/Delete" method="post">
<input type="submit" class="submitLink" value="member2" />
<input type="hidden" name="hfmem2" id="hfmem2" value="2" />
</form>
它在 Mozilla 中工作,但在 IE 中不工作。我在 contoller 中的 formcollection 中有调试和检查值。要做什么。?
【问题讨论】:
标签: asp.net-mvc-2