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
In Process

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?

  • 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. 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 71k
  • Answers 71k
  • 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 I just had the same problem, and I found a… May 11, 2026 at 1:16 pm
  • added an answer 'In order to understand recursion, you must first understand recursion...'… May 11, 2026 at 1:16 pm
  • added an answer You can use the onchange client event: <%= Html.DropDownList('qchap', new… May 11, 2026 at 1:16 pm

Related Questions

No related questions found

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.