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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:14:30+00:00 2026-06-12T00:14:30+00:00

I have an action as follows: public ActionResult ChangeFeeCheck(string id) { ViewBag.id = id;

  • 0

I have an action as follows:

    public ActionResult ChangeFeeCheck(string id)
    {

       ViewBag.id = id;
       return View();
    }

on my View, I have the following:

    @{
      ViewBag.Title = "CreateList";
     }



     Please enter first name <br /><br />


    @using (Html.BeginForm())
    {

    @Html.Textbox("firstname")

    <input type="button" id="SaveChanges" value="Save" />  
    }    

When I click on the button, I was expecting it to to the following

    [HttpPost]
public ActionResult ChangeFeeCheck(string firstname)
    {
      .....

    }

I am not sure when MVC will automatically go to the HttpPost or if I when need to manually have it there. In the above, it does not go there directly. I have to use the

    window.location.href

and pass the url of the controller/action.

Meaning, isn’t the default for

    Html.BeginForm()

The HttpPost(same name as the HttpGet)

  • 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-06-12T00:14:31+00:00Added an answer on June 12, 2026 at 12:14 am

    If you are following “Convention over configuration” rule over here, then the view you have created here must be for ChangeFeeCheck action, and ChangeFeeCheck here looks like will make compiler confused as no overload, same name, same signatures.

    and then when method for form is get it would go to the first one, while if method for form is POST, it will call the one decorated with [HttpPost]

    And because you are using submit button and by default HTML form generated uses POST action, it call the [HttpPost]

    You can refer this article (from the internet archive as original link is now down): https://web.archive.org/web/20120527133344/http://microsoftmentalist.com:80/2011/09/07/asp-net-mvc-difference-between-httpget-and-httppost-with-example/

    See for example how GET and POST action methods are overloaded.

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

Sidebar

Related Questions

I have an action method to handle the HTTP-POST as follows. [HttpPost] public ActionResult
I have a controller action which renders a partial view: public ActionResult Details(int id)
I have an action in my controller as follows. // // GET: /HostingAgr/Details/1 public
I have a controller with an action method as follows: public class InventoryController :
I'm using MVC3 and in my view I have the following code block; Response.Redirect(@Url.Action(index,home,
I have the a rule with an action defined as follows: metric_expr : metric=NAME
I have an ASP.NET MVC 3 controller action. That action is defined as follows:
I have a html file like following: <form action=/2811457/follow?gsid=3_5bce9b871484d3af90c89f37 method=post> <div> <a href=/2811457/follow?page=2&amp;gsid=3_5bce9b871484d3af90c89f37>next_page</a> &nbsp;<input
I have a action link on my MVC3 razor view. Which have a action
m having problem in passing parameter to controller action, i have done the following

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.