views:

269

answers:

1

Hi

I am trying to make a very simple login page for a sitecore project (V5). I have a page where anonymous access is denied. The user is then redirected to a login page defined in the web.config. I have the following code on that login.aspx page;

    <%@ Page language="c#" AutoEventWireup="false" %>
<script runat="server">
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
    e.Authenticated = Sitecore.Context.Domain.Login(Login1.UserName, Login1.Password).Success;
}
</script>

<form id="Form1" method="post" runat="server">
    <asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate" DisplayRememberMe="false"></asp:Login>    
</form>

But hits does not seem to work - nothing happends. Any ideas?

+1  A: 

You need to elaborate what you mean by "nothing happens." Is the OnAuthenticate handler not firing? Is the authentication method failing? You do realize you still need to write some code for this control, right? :)

One thing it's easy to inadvertently do is to create a Login page that does not redirect the user after login... so it appears they are still not logged in, when really they are.

Bryan