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 ProfileTest : System.Web.UI.Page
{
   protected void Page_Load(object sender, EventArgs e)
   {
      if (! IsPostBack)
      {
         SetPageData();

         // ustaw wartości początkowe kontrolek zgodnie z wartościami profilu
         drpRegion.SelectedValue = Profile.Region;
         drpBackColor.SelectedValue = Profile.BackgroundColor;
         drpTextColor.SelectedValue = Profile.TextColor;
      }

   }
   protected void btnSave_Click(object sender, EventArgs e)
   {
      Profile.Region = drpRegion.SelectedValue;
      Profile.BackgroundColor = drpBackColor.SelectedValue;
      Profile.TextColor = drpTextColor.SelectedValue;

      SetPageData();
   }
   private void SetPageData()
   {
      body1.Attributes["bgcolor"] = Profile.BackgroundColor;
      body1.Attributes["text"] = Profile.TextColor;
      labWhere.Text = Profile.Region;
   }
}
