I know this is old, but I just stumbled across the question and since I've done this wanted to share my solution in case anyone else should have need.
The catch is you need to handle the OnAuthenticate
event of the asp:Login
control. In the simplest form you would have this in the aspx:
<asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate">
</asp:Login>
And this in the code behind:
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) {
e.Authenticated = FormsAuthentication.Authenticate(Login1.UserName, Login1.Password);
}
And this in web.config:
<membership>
<providers>
<clear/>
</providers>
</membership>
<authorization>
<allow users="?"/>
</authorization>
<authentication mode="Forms">
<forms cookieless="UseCookies" loginUrl="~/Login.aspx" path="/" protection="None" name="user_login_cookie">
<credentials passwordFormat="Clear">
<user name="user" password="password_in_clear!"/>
</credentials>
</forms>
</authentication>
This will get you a simple login form with a hardcoded user in web.config. Good for prototypes and demos, please don't put user accounts in web.configs for live sites!