Forgive my somewhat missing ASP.NET knowledge for this question :)
Here's the scenario: I play in VS2010, I created a new ASP.NET Web Application
(in Visual C #, web templates). Nothing special, just a basic web application. No fancy MVC materials.
The template created by the template includes a login page; Account/Login.aspx
. There is a "Login" button on this page; HTML looks like this:
<p class="submitButton"> <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="LoginUserValidationGroup"/> </p>
Again, nothing out of the ordinary. Now the code is behind:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Account_Login : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]); } }
Even less imagination. And finally from web.config:
<authentication mode="Forms"> <forms loginUrl="~/Account/Login.aspx" timeout="2880"/> </authentication>
So here is what I can’t understand. : when I start the application, I can click the "Login" button, and the application does something, but where is the code for something?
From the world of WPF (with some experience with ASP.NET), my first instinct is to reset CommandName
, but searching for anything related to “Login” becomes dry. My second instinct is to look at the code, but again, it’s pretty sparse, and I don’t see anything like it having anything to do with clicking the Login button.
So where does the “magic” behind this button happen? There must be something; I feel that I am losing sight of what is sitting right in front of my eyes.