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

So I had this working perfectly fine, but now for some reason I can't
For some reason jQuery won't load on my website. I've tried it in google
I am writing code to work with Amazon query based APIs, which return XML
My company has, in essence, undertaken a project to replace some of its pagers
i am merging couple of rss feed from user profile in wordress where the
Background: I created my own TagLib for application. One of the tags must depend
Well, to be honest this is actually my homework where I have to implement
I'm trying to do something that I can't really find any help on. I
I'm working on a GUI that allows the user to manipulate xml files. I
So, I created my entity model in a separate class library. I had to

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.