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;

public partial class Login : System.Web.UI.Page {
    protected override void InitializeCulture() {
        //ProfileCommon p = (ProfileCommon)this.Context.Profile;

        //if (Request.Form.Get("ctl00$selLanguage") != null)
        //    p.lang = Request.Form.Get("ctl00$selLanguage").ToString();
        //if (p.lang == String.Empty)
        //    p.lang = Session["Localization"].ToString();

        //if (p.lang.Length > 0) {
        //    this.Culture = p.lang;
        //    this.UICulture = System.Globalization.CultureInfo.CreateSpecificCulture(p.lang).Name;
        //}
    }


    protected void Page_Load(object sender, EventArgs e) {

    }
    ////// Login1_LoggedIn 時尚未寫入至 Profile.UserName ,所以在導至 @"Personal\PersonalHome.aspx"
    ////// 時會權限不足, 這裡利用 bIsLogged 當作解決方法
    ////private bool bIsLogged = false; 
    protected void Login1_PreRender(object sender, EventArgs e) {
        //////if (bIsLogged )
        //////    Response.Redirect(@"Personal\PersonalHome.aspx");
    }
    protected void Login1_LoggedIn(object sender, EventArgs e) {
        ////bIsLogged = true;
        Response.Redirect(@"default.aspx");
    }

    protected void LoginButton_Click(object sender, EventArgs e) {
        if (Membership.ValidateUser(Login1.UserName, Login1.Password)) {
            FormsAuthentication.RedirectFromLoginPage(Login1.UserName, false);
        }
    }

}
