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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:55:50+00:00 2026-05-23T00:55:50+00:00

For some reason both the Get and Post fire the first action. public ActionResult

  • 0

For some reason both the Get and Post fire the first action.

public ActionResult Login()
{
   return View();
}

[HttpPost]
public ActionResult Login(FormCollection form)
{
   // Login Stuff here... never gets reached!
}

I’ve basically copied this directly from the MVC music store sample. Tried it in another app and it worked fine.

this is a fairly new project, used the base MVC3 project template in Visual Studio, all the default settings.

I made sure the HTML output specifies the POST method:

<form action="/Home/Login" method="post">

Here is my Login.cshtml

@{
    ViewBag.PageTitle = "Login";
}
<section id="index">
<header>
    <h2>Login</h2>
</header>
<content>
    @using (Html.BeginForm("Login", "Home", FormMethod.Post))
    {
        <panel id="login">
            <table>
                <tr>
                    <td>Email:</td>
                    <td><input name="Email" /></td>
                </tr>
                <tr>
                    <td>Password:</td>
                    <td><input name="Password" type="password" /></td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><input type="submit" value="Login" /></td>
                </tr>
            </table>
        </panel>
    }
</content>
</section>

After I submit the form I see this URL in my browser:

http://localhost:51606/Home/Login?Email=me@email.com&Password=mypass

Those fields should not be in the URL! Why on earth is my form getting converted to a GET request?

  • 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-23T00:55:51+00:00Added an answer on May 23, 2026 at 12:55 am

    Looking at the HTML output some more, I spotted another form tag surrounding my form.

    Turns out someone (me) put a form tag in the Views/Shared/_Layout.cshtml, which is the default shared layout.

    bah, figures after typing in the question here I would find the problem.

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

Sidebar

Related Questions

Both methods MyBehavior::CreateSerializer() are not called of some reason, but ReplaceBehavior() method is working.
This seems so basic but for some reason I can't get it to work
I've used Scriptaculous before (including effect queues). For some reason, I can not get
For some reason I can no longer post a comment as an Anonymous user
I'm trying to get tweets using the Twitter API, but for some reason this
For some reason I can't get Basic Authentication to work using PHP on my
I'm trying to get css3pie to work with asp.net mvc, but for some reason
This seems like the most common relationship but for some reason I cannot get
For some reason I never see this done. Is there a reason why not?
For some reason when I attempt to make a request to an Ajax.net web

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.