Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6747359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:25:59+00:00 2026-05-26T12:25:59+00:00

I am using ASP.NET MVC 2 with C#. Per the requirements for an application

  • 0

I am using ASP.NET MVC 2 with C#. Per the requirements for an application I’ve developed, each view has several buttons that execute the same Controller Post action. Currently, to know what button was clicked when the action was posted, I am using a hidden field on the form called PageAction. This field is set with a value when any button is clicked. This has caused a fair amount of issues in the controller implementation of the POST action for this view because I have to do a case statement against the value submitted via PageAction. It’s one of those things that seems like it could be done better and simpler.

Is there a way to have multiple actions for a single view? This way each button would post the form to it’s own controller action (yet all of these would correlate to the same view). I’d like to get away from the “magic string” checking on the PageAction value; however, all of these buttons are part of the same html form so I’m not sure how this would be possible aside from splitting each button into it’s own form or having each button dynamically change where the form posts to. Both of the latter options sound like they’d be more complicated than what I am already doing.

All suggestions/comments are welcomed. Thanks!

EDIT 1

I’ve gone through the blog post linked here: http://blog.ashmind.com/2010/03/15/multiple-submit-buttons-with-asp-net-mvc-final-solution/ and replicated the functionality, but I was wondering…how would this work if the button names on a page are standardized across several different pages in an application? The blog post seems to assume distinct button names matching the action name in the controller, but in my case this won’t be unique enough.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:25:59+00:00Added an answer on May 26, 2026 at 12:25 pm

    You may find the following blog post useful which illustrates the usage of a custom ActionNameSelectorAttribute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ASP.NET MVC 2, and am using a view-model per view approach.
I have an ASP.NET MVC application that is calendar-like. As per the NerdDinner example,
Using Asp.net MVC, I have one view that's strongly bind to List , and
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using asp.net MVC I'd like to do this inside a view: <%= Html.TextBox(textbox1, null,
Using ASP.NET MVC 2.0, I have an actionlink that is used for comments on
I am implementing a SaaS application using ASP.Net MVC 2 and SQL Server database.
I'm in the process of building my first web application using ASP.NET MVC 2
We are submitting an asp.net mvc view form using the knockoutjs postJson util. All
Here's a little background on my solution: ASP.Net MVC app Using Linq-to-SQL with table-per-hierarchy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.