using SteamWare;
using System;
using System.Web.UI;

namespace NKC_WF.WebUserControls
{
    public partial class cmp_homeButtons : BaseUserControl
    {
        #region Private Methods

        /// <summary>
        /// aggiornamento del menù
        /// </summary>
        private void updateTreeMenu()
        {
            try
            {
                if (string.IsNullOrEmpty(user_std.UtSn.mappaSito))
                {
                    Response.Redirect("Default", true);
                }
                else
                {
                    XmlMenu.Data = user_std.UtSn.mappaSito;
                    XmlMenu.XPath = "mainMenu/menu";
                    XmlMenu.DataBind();
                }
            }
            catch
            {
                Response.Redirect("Default", true);
            }
        }

        #endregion Private Methods

        #region Protected Methods

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                updateTreeMenu();
            }
        }

        #endregion Protected Methods
    }
}