protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Request.Params["IdDashboardItem"] == null)
            {
                Response.Redirect("/Pages/Default.aspx");
            }

            // Build the full path to the dashboard item's definition file.
            string fileName = Path.Combine(
                this.Request.PhysicalApplicationPath,
                "Fileadmin",
                "DashboardItems",
                Global.Core.ClientName,
                this.Request.Params["IdDashboardItem"] + ".xml"
                );

            if (!File.Exists(fileName))
            {
                Response.Redirect("/Pages/Default.aspx");
            }

            DashboardItem dashboardItem = new DashboardItem(fileName);

            if (dashboardItem.LatestUses.ContainsKey(Global.IdUser.Value))
            {
                dashboardItem.LatestUses[Global.IdUser.Value] = DateTime.Now;
            }
            else
            {
                dashboardItem.LatestUses.Add(Global.IdUser.Value, DateTime.Now);
            }

            dashboardItem.Save();

            lblDefinitionName.Text = dashboardItem.Name;

            //frame.Attributes["src"] = HttpUtility.UrlDecode(dashboardItem.Source);
            Page.ClientScript.RegisterStartupScript(
                this.GetType(),
                "LoadDashboard",
                "loadFunctions.push(function() { document.getElementById('cphContent_frame').src = '" + HttpUtility.UrlDecode(dashboardItem.Source) + "'; });",
                true
                );
        }
        protected void btnDashboardItemSave_Click(object sender, EventArgs e)
        {
            // Build the full path to the selected
            // dashboard item's definition file.
            string fileName = Path.Combine(
                Request.PhysicalApplicationPath,
                "Fileadmin",
                "DashboardItems",
                Global.Core.ClientName,
                (Guid)grid.SelectedItem + ".xml"
                );

            DashboardItem info = new DashboardItem(fileName);

            info.Name   = txtDashboardItemTitle.Text;
            info.Source = HttpUtility.UrlEncode(txtDashboardItemSource.Text);

            info.Save();

            Response.Redirect(Request.Url.ToString());
        }