using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; public partial class muutkujundus_nupufail : System.Web.UI.Page { protected void Page_PreInit(object sender, EventArgs e) { if (Session["n2gu"] != null) { Page.Theme = Session["n2gu"] as string; } } protected void Page_Init(object sender, EventArgs e) { // string[] nahad = { "sinine", "kollane" }; if (!IsPostBack) { // DropDownList1.DataSource = nahad; // DropDownList1.DataBind(); DirectoryInfo di = new DirectoryInfo(Server.MapPath("~/App_Themes")); DropDownList1.DataSource = di.GetDirectories(); DropDownList1.DataTextField = "Name"; DropDownList1.DataBind(); } } protected void Page_Load(object sender, EventArgs e) { } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { Session["n2gu"] = DropDownList1.Text; Server.Transfer("nupufail.aspx", false); } protected void DropDownList1_PreRender(object sender, EventArgs e) { DropDownList1.SelectedValue = (string)Session["n2gu"]; } }