I'm trying to add simple login page to ASP.NET MVC app. I actually use Sharp Arch template project. So, I added 3 methods Login(), Logout(), and DoLogin() to UsersController, where Login() just does return View("Login");
Now, when I navigate to /Users/Login, my aspx is displayed with submit button:
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage" Title="Login" %>
<%@ Import Namespace="Orders.Web.Controllers" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<h2>Login</h2>
<% if (ViewContext.TempData["message"] != null){ %>
<p><%= ViewContext.TempData["message"]%></p>
<% } %>
<% using (Html.BeginForm<UsersController>(u => u.DoLogin()))
{ %>
<div><% =Html.SubmitButton("submit") %></div>
<% } %>
</asp:Content>
However, when I click Submit, request is made once again to Login() - I can see it when I set breakpoint there, it doesn't try to go to UsersController.DoLogin() even though in resulting HTML page form has action /Users/DoLogin. When I manually enter /Users/DoLogin in browser, it gets called and my breakpoint gets fired.
I'm banging my head for few hours already... I don't see whats wrong here.