Supporting multiple submit buttons on an ASP.NET MVC view(blog.maartenballiauw.be)
submitted by
maartenba(5845) 2 years, 2 months ago
A while ago, I was asked for advice on how to support multiple submit buttons in an ASP.NET MVC application, preferably without using any JavaScript. The idea was that a form could contain more than one submit button issuing a form post to a different controller action.
The above situation can be solved in many ways, one a bit cleaner than the other. For example, one could post the form back to one action method and determine which method should be called from that action method. Good solution, however: not standardized within a project and just not that maintainable… A better solution in this case was to create an ActionNameSelectorAttribute.
|category: MVC
|Views: 802
tags:
ASPNETMVC MVC ASPNET another
Everyones tags:
Your Tags: