using System;
using System.Data;
using System.Configuration;
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 System.Threading;
using System.Globalization;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
      
    }
    protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
        try
        {
            Panel1.BackColor = System.Drawing.Color.FromArgb(int.Parse(TextBox1.Text), int.Parse(TextBox2.Text), int.Parse(TextBox3.Text));
        }
        catch
        {
            TextBox1.Text = "Błąd!";
            TextBox2.Text = "Błąd!";
            TextBox3.Text = "Błąd!";
        }
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string opcja = DropDownList1.SelectedValue;
        //Thread.CurrentThread.CurrentUICulture = new CultureInfo(opcja);
        //Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(opcja);
        Session["culture"] = opcja;
        Response.Redirect(Request.Url.LocalPath);

    }
    protected override void InitializeCulture()
    {
        if (Session["culture"] != null)
        {
            this.UICulture = Session["culture"].ToString();
            this.Culture = Session["culture"].ToString();
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Session["culture"].ToString());
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(Session["culture"].ToString());
        }
        base.InitializeCulture();
    }

    protected void MultiView1_ActiveViewChanged(object sender, EventArgs e)
    {

    }
}

