ASP.NET MVC Ajax.BeginForm eats params of submit button clicked. Looks like bug

后端 未结 5 1613
粉色の甜心
粉色の甜心 2021-02-11 04:33

If you are using Ajax.BeginForm() with multiple submit buttons similar to this:

// View.aspx
<% using (Ajax.BeginForm(\"Action\", \"Controller\", 
                    


        
5条回答
  •  天命终不由人
    2021-02-11 05:02

    In order for your submit buttons to be "successfull" controls as per the specification, they must be defined within the form element:

    http://www.w3.org/TR/html401/interact/forms.html#successful-controls

    If you can't nest your submit buttons inside your form, you'll probably need to use javascript (or jquery) to submit your form and pass in an additional paramater to indicate which button was clicked.

提交回复
热议问题