using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace DataIllusion.NetPolls.WebAdmin
{
	/// <summary>
	/// Summary description for Login.
	/// </summary>
	public partial class Login : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Literal NSurveyAuthenticationTitle;

		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}

		private void InitializeComponent()
		{

		}
	
		protected void Page_Load(object sender, System.EventArgs e)
		{
		}


		protected void ValidateCredentialsButton_Click(object sender, System.EventArgs e)
		{
			if (FormsAuthentication.Authenticate(LoginTextBox.Text, PasswordTextBox.Text)) 
			{
				FormsAuthentication.SetAuthCookie(LoginTextBox.Text, false);
				Response.Redirect("pollsettings.aspx");
			}
			else
			{
				MessageLabel.Visible = true;
				MessageLabel.Text = "invalid login / password";
			}
		}
		
	}
}
