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 ComboBox_UpdatePanel : System.Web.UI.Page
{
//Global variables
protected static string Skin = "";
protected static string Structure = "";
protected void Page_Load(object sender, EventArgs e)
{
ScriptManager sm = ScriptManager.GetCurrent(Page);
//Set defaults
if (sm.IsInAsyncPostBack == false &&
Page.IsCallback == false &&
Page.IsPostBack == false)
{
Skin = "Classic";
Structure = "Default.xml";
}
//Check defaults
if (Skin == "") Skin = "Classic";
if (Structure == "") Structure = "Default.xml";
BuildControl();
}
protected void Button1_Click(object sender, EventArgs e)
{
Skin = "GrayScale";
Structure = "Default.xml";
BuildControl();
}
protected void Button2_Click(object sender, EventArgs e)
{
Skin = "AOL";
Structure = "Search.xml";
BuildControl();
}
private void BuildControl()
{
myComboBox.SkinFolder = "~/ComboBox/Skins/" + Skin;
myComboBox.StructureFileURL = "~/ComboBox/Structures/" + Structure;
myComboBox.DataBind();
}
}
|