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 Menu_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 = "Office2003";
        Structure = "Office2003.xml";
        BuildControl();
    }


    protected void Button2_Click(object sender, EventArgs e)
    {
        Skin = "Win7";
        Structure = "Win7.xml";
        BuildControl();
    }


    private void BuildControl()
    {
        myMenu.StructureFileURL = "~/Menu/Structures/" + Structure;
        myMenu.SkinFolder = "~/Menu/Skins/" + Skin;
        myMenu.DataBind();
    }

}