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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:36:52+00:00 2026-06-11T19:36:52+00:00

Html.BeginForm("LogOn", "Home", FormMethod.Post) LogOn – Action. Home – Controller. So It will create the

  • 0

Html.BeginForm("LogOn", "Home", FormMethod.Post)

LogOn – Action.

Home – Controller.

So It will create the Url like = Home/LogOn .

But If I have action LogOn(String s ) , LogOn(int i) inside the controller Home and both are HttpPost ,
Then which one action raise at that time . means right now it is giving exception :

"ambiguous between the

following action methods"

  • 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-11T19:36:53+00:00Added an answer on June 11, 2026 at 7:36 pm

    You cannot have 2 actions with the same name inside the same controller. The only way for this to work is to make one of the 2 actions accessible only with [HttpPost]:

    public ActionResult LogOn(int i)
    {
        ...
    }
    
    [HttpPost]
    public ActionResult LogOn(string s)
    {
        ...
    }
    

    Now when you submit the form it will invoke the second action. And when you type /home/logon in your browser address bar (using GET verb) it will execute the first action to probably render the LogOn form.

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

Sidebar

Related Questions

I have something like this: Main view: @model AuthorViewModel @using (Html.BeginForm(Action, Controller, FormMethod.Post, new
Here is my controller code and also my View: @using (Html.BeginForm(Create, Product, FormMethod.Post, new
I dynamically draw checkboxes in my form: @using (Html.BeginForm(Action, Controller, FormMethod.Post, new { id=itemsList}))
If I have a CheckBoxList within a form, like this... @using (Html.BeginForm("Save", "Product", FormMethod.Post))
In ASP.NET MVC I'm using the HTML helper Html.BeginForm(ActionName, Controller, FormMethod.Post); But I need
<% Html.BeginForm(Index, Home, FormMethod.Post, new { id = form_logon }); %> or <form id
I have page with form: @using (Html.BeginForm(Create, Theme, FormMethod.Post, new { id = frm_post,
I have a form like below:- <% using ( Html.BeginForm(search, home, FormMethod.Get) ) {
<%using (Html.BeginForm(OrderDevice, ImportXML, FormMethod.Post)) { %> <table id=OrderDevices class=data-table> <tr> <th> DeviceId </th> <th>
// html <% using (Html.BeginForm(MyAction, MyController, new { id = ViewContext.RouteData.Values[id] }, FormMethod.Post, new

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.