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

  • Home
  • SEARCH
  • 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 101087

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:42:13+00:00 2026-05-11T00:42:13+00:00

I am having problems getting my form to Post to my Save method in

  • 0

I am having problems getting my form to Post to my Save method in a controller. I am new to MVC, and have followed several examples to try to get this to work. Here is my html markup:

    <form action='Edit/Save' method='post'>         <fieldset>             <legend>Personal Information</legend>              <table class='editGrid'>                 <tr>                     <td><label for='txtFirstName'>First Name:</label></td>                     <td><input type='text' id='txtFirstName' value='<%=user.FirstName %>' name='FirstName' /></td>                                     </tr>                 <tr>                     <td><label for='txtLastName'>Last Name:</label></td>                     <td><input type='text' id='txtLastName' value='<%=user.LastName %>' name='LastName' /></td>                                     </tr>                 <tr>                     <td><label for='txtNtLogin'>NT Login:</label></td>                     <td><input type='text' id='txtNtLogin' value='<%=user.NtLogin %>' name='NtLogin' /></td>                                    </tr>                 <tr>                     <td><label for='txtHireDate'>Hire Date:</label></td>                     <td><input type='text' id='txtHireDate' value='<%=string.Format('{0:d}',user.HireDate) %>' name='HireDate' /></td>                                </tr>             </table>         </fieldset>          <fieldset>             <legend>Job Information</legend>              <table class='editGrid'>                 <tr>                     <td><label for='CostCenters'>Cost Center:</label></td>                     <td><%=Html.DropDownList('CostCenters')%></td>                 </tr>                 <tr>                     <td><label for='Managers'>Manager:</label></td>                     <td><%=Html.DropDownList('Managers')%></td>                 </tr>                 <tr>                     <td><label for='Responsibilities'>Responsibility:</label></td>                     <td><%=Html.DropDownList('Responsibilities')%></td>                 </tr>                 <tr>                     <td><label for='Departments'>Department:</label></td>                     <td><%=Html.DropDownList('Departments')%></td>                                         </tr>                 <tr>                     <td><label for='Active'>Active:</label></td>                     <td><%=Html.CheckBox('Active',user.Active) %></td>                 </tr>                 <tr>                     <td><label for='txtHireDate'>Hire Date:</label></td>                     <td><%=Html.TextBox('txtHireDate',string.Format('{0:d}',user.HireDate)) %></td>                 </tr>                 <tr>                     <td><label for='txtReleaseDate'>Release Date:</label></td>                     <td><%=Html.TextBox('txtReleaseDate',string.Format('{0:d}',user.ReleaseDate)) %></td>                 </tr>             </table>         </fieldset>         <input type='submit' value='Save Changes' />     </form> 

This form routes to a Save method in my EditController. Here is the code for my EditController’s Save method:

    public class EditController : Controller     {          public ActionResult Save()         { //Save code goes here           } 

I have tried using the html form tag, and also the Html helper code:

using (Html.BeginForm('Save', 'Edit'))  

Here is the entry from my RegisterRoutes method in the Global.asax file:

    routes.MapRoute('EditSave', '{controller}/Save',                     new { controller = 'Edit', action = 'Save' }); 

No matter what I do, the submit button does not trigger the Save method. Yet, if I manually key in the Url, The code breaks right into the Save method.

Edit: Per Craig Stuntz’s comment, I checked the source of the page. The page actually contains 2 forms, although only 1 is coded on the page by myself: Here is the HTML that appears prior to my form tag:

<form name='aspnetForm' method='post' action='44' id='aspnetForm'> <div> <input type='hidden' name='__VIEWSTATE' id='__VIEWSTATE' value='/wEPDwUJNjM3OTAyNTUzZGQrHhVn9+t78aHxN0vHvKUJ8DQWlQ==' /> </div>                  <div id='nav'>                     <span id='navLinks'>                         <a href='#'>Placeholder Link</a>                     </span>                     <span id='userName'>                         <span id='ctl00_lblUserName' class='UserName'>Welcome, Test User</span>                     </span>                  </div>                   <div id='Content'>       <div id='formContainer'>              <form action='Edit/Save' method='post'> 

I didn’t think MVC generated viewstate or additional form tags. I am pulling data and populating it into this form using another method from the same controller. Am I doing something wrong here?

  • 0 0 Answers
  • 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. 2026-05-11T00:42:14+00:00Added an answer on May 11, 2026 at 12:42 am

    Ok, got the answer. And thanks Craig for having me look at the HTML again! My master page had generated a form tag in it without my knowing it, so I essentially had nested forms on the same page. After I removed the form from the Master Page, everything worked perfectly.

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

Sidebar

Ask A Question

Stats

  • Questions 67k
  • Answers 67k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer No there is not a Replace method in the BCL… May 11, 2026 at 11:56 am
  • added an answer I believe you need something like: class MyRegistry : Registry… May 11, 2026 at 11:56 am
  • added an answer This link should help you out: http://silverlight.net/forums/p/11519/36798.aspx EDIT And this… May 11, 2026 at 11:56 am

Related Questions

I am having problems getting my form to Post to my Save method in
I am having a problem getting my project to link with the PhysX libraries
I am having problems getting text within a table to appear centered in IE.
I'm trying to merge two main menus together, but am having problems getting the
I am having a problem getting a list of fields from a query defined
I am having problems manually looping through xml data that is received via an
I am having problems converting a string in the format yyyy-MM-ddZ using VB.net. For
I am having problems with text with multiple lines not reformatting properly when I
I am having problems connecting to a Sqlite database through System.Data.Sqlite. I was trying
I am having problems using django-tagging . I try to follow the documentation but

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.