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

后端 未结 30 2996
一个人的身影
一个人的身影 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:40

    I would suggest interested parties have a look at Maarten Balliauw's solution. I think it is very elegant.

    In case the link dissapears, it's using the MultiButton attribute applied to a controller action to indicate which button click that action should relate to.

提交回复
热议问题