How do you handle multiple submit buttons in ASP.NET MVC Framework?

后端 未结 30 3517
一个人的身影
一个人的身影 2020-11-21 07:16

Is there some easy way to handle multiple submit buttons from the same form? For example:

<% Html.BeginForm(\"MyAction\", \"MyController\", FormMethod.Pos         


        
30条回答
  •  孤城傲影
    2020-11-21 07:41

    David Findley writes about 3 different options you have for doing this, on his ASP.Net weblog.

    Read the article multiple buttons in the same form to see his solutions, and the advantages and disadvantages of each. IMHO he provides a very elegant solution which makes use of attributes that you decorate your action with.

提交回复
热议问题