Can I have one form tag inside Another in ASP.net MVC RC2

I'm currently developing an application in MVC2. I want to use mutiple form tags in My application. In my opinion, I have created a table with the Delete option, which I do through Post for individual deletion, so I have a Create form tag for each button. I also want the user to be able to delete mutated entries, so I provide them with checkboxes. This form should have all the values ​​of the flags and all. so the form gets rendered like this

for each delete button

 <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>

Does not work. but IF I write my code that forms in this way

    <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>

It works in Mozilla, but not in IE. I have debugging and verified values ​​in a formcollection. In contoller. What to do ??

+5
5

XHTML , .

, , / . , "" , , jQuery.

:

    [Authorize]
    [HttpPost]
    public JsonResult Delete(Guid id)
    {
         // do stuff, delete the item
         return Json(succeeded ? Id.ToString() : "error");
    }

<a href="#" onclick="$.post('/Stuff/Delete/' + id, function(data) { deleteCallback(data); }); return false;">delete</a>

function deleteCallback(data)
{
  if(data=="error"){
    /* error handler for UI */
  }
  else {
    /*remove the entry from the user interface*/
  }
};

multi-delete, , URL- ( IE 2k, ), :

arrayVariable = new Array(); 
// fill array with ids associated to checked checkboxes' entries
$.post('/Stuff/Delete/' + id, {'IdsToDelete' : arrayVariable }, function(data) { deleteCallback(data); }); return false;">

.NET-, GUID, !

EDIT: . CSRF ( ). , .

[ValidateAntiForgeryToken] , -

var token = $('input[name=__RequestVerificationToken]').val();
$.post("/YourUrl", { 'IdsToDelete' : arrayVar, '__RequestVerificationToken': token }, function(data) { deleteCallback(data); });
+5

undefined .

+4

. Action Links ? , .

+2

? , javascript html.

, Request.Params , .

<form action="<%= Html.Encode(Url.Action("Delete"))%>">
<ul>
<li>Item 1 <input type="submit" id="<%= IDSafe(item_id) %>" name="<%= IDSafe(item_id2) %>" value="Delete" /></li>
<li>Item 2 <input type="submit" id="<%= IDSafe(item_id2) %>" name="<%= IDSafe(item_id2) %>" value="Delete" /></li>
</ul>
<input type="submit" name="deleteall" value="Delete selected" />
</form>
0

, , . , , , , - , , .

<input type="submit" name="submitbutton"   id="<%= Html.Encode(item.ideletevalue) %>" class="submitLink"   value=" <%= Html.Encode(item.deleteitemname)%>"/> 
0

All Articles