protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (Session["userLogged"] == null || Session["currentCockpitConfiguration"] == null)
            {
                Response.Redirect("Login.aspx");
            }

            lblUserLogged.Text = Session["userLogged"].ToString();

            gadgetManager = new GadgetManager();

            createCategoriesPanels();

            createDialog();
        }
        /// <summary>
        /// This method has to regroup all informations concerning cockpit configuration
        /// based on parameter <paramref name="userName"/>. Once it's done, an instance
        /// of <c>CockpitConfiguration</c> is created and returned.
        /// </summary>
        /// <param name="userName">Contains the userName needed to know which cockpit 
        /// configuration to restore from database.</param>
        /// <returns>The new instance of <c>CockpitConfiguration</c> is returned.</returns>
        /// <exception cref="Exception">An exception is raised and thrown if a problem occurs 
        /// with database query.</exception>
        /// <remarks>If the user hasn't any cockpit configuration attributed, a default
        /// one is loaded.</remarks>
        public CockpitConfiguration getConfiguration(string userName)
        {
            XmlDocument configurationXml = getConfigurationXml(userName);
            int configurationID = int.Parse(configurationXml.GetElementsByTagName("cockpitConfiguration")[0].Attributes.GetNamedItem("ID").InnerText);

            /*
             * Then, display configuration is restored
             */
            XmlNode cockpitDisplayConfigIdNode = configurationXml.GetElementsByTagName("displayConfig")[0];

            int displayConfigurationID = int.Parse(cockpitDisplayConfigIdNode.InnerText);

            DisplayConfigurationManager displayManager = new DisplayConfigurationManager();
            DisplayConfiguration displayConfiguration = displayManager.getDisplayWithId(displayConfigurationID);

            /*
             * Finally, the list of gadgets used in the cockpit configuration are
             * restored and created.
             */
            XmlNodeList gadgetNodes = configurationXml.GetElementsByTagName("gadget");
            GadgetManager gadgetManager = new GadgetManager();
            List<Gadget> gadgets=new List<Gadget>();
            int gadgetId, gadgetPosition, uniqueId=0;

            foreach (XmlNode gadgetNode in gadgetNodes)
            {
                gadgetId = int.Parse(gadgetNode.Attributes.GetNamedItem("ID").InnerText);
                gadgetPosition = int.Parse(gadgetNode.Attributes.GetNamedItem("column").InnerText);
                Gadget gadgetToAdd = gadgetManager.getGadgetWithId(gadgetId);
                gadgetToAdd.setPosition(gadgetPosition);
                gadgetToAdd.setUniqueID(uniqueId++);
                gadgets.Add(gadgetToAdd);
            }

            return new CockpitConfiguration(configurationID, gadgets, displayConfiguration);
        }