|
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DashboardBusiness;
public partial class LoginPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void LoginButton_Click( object sender, EventArgs e)
{
if( Membership.ValidateUser( Email.Text, Password.Text ) )
{
FormsAuthentication.RedirectFromLoginPage( Email.Text, RememberMeCheckbox.Checked );
}
else
{
InvalidLoginLabel.Visible = true;
}
}
protected void RegisterButton_Click( object sender, EventArgs e)
{
try
{
MembershipUser user = Membership.CreateUser( Email.Text, Password.Text, Email.Text );
if( user != null )
{
new DashboardFacade(Profile.UserName).RegisterAs( Email.Text );
FormsAuthentication.RedirectFromLoginPage( Email.Text, RememberMeCheckbox.Checked );
Response.Redirect( "~/Default.aspx" );
}
else
{
InvalidLoginLabel.Visible = true;
}
}
catch
{
InvalidLoginLabel.Visible = true;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.