コード例 #1
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        protected override void OnInit(EventArgs e)
        {
            if (!(this.Page.IsClientScriptBlockRegistered("confirmDelete")))
            {
                string[] s = { "CONFIRM_DELETE" };
                this.Page.RegisterClientScriptBlock("confirmDelete", PortalSettings.GetStringResource("Rainbow.aspnet_client.Rainbow_scripts.confirmDelete.js", s));
            }

            if (topDeleteButton.Attributes["onclick"] != null)
            {
                topDeleteButton.Attributes["onclick"] = "return confirmDelete();" + topDeleteButton.Attributes["onclick"];
            }
            else
            {
                topDeleteButton.Attributes.Add("onclick", "return confirmDelete();");
            }

            if (bottomDeleteButton.Attributes["onclick"] != null)
            {
                bottomDeleteButton.Attributes["onclick"] = "return confirmDelete();" + bottomDeleteButton.Attributes["onclick"];
            }
            else
            {
                bottomDeleteButton.Attributes.Add("onclick", "return confirmDelete();");
            }

            InitializeComponent();

            base.OnInit(e);
        }
コード例 #2
0
ファイル: AddTab.aspx.cs プロジェクト: arrioja/shared-citroen
        /// <summary>
        /// Raises the Init event.
        /// </summary>
        /// <param name="e"></param>
        override protected void OnInit(EventArgs e)
        {
            InitializeComponent();

            //Confirm delete
            if (!(IsClientScriptBlockRegistered("confirmDelete")))
            {
                string[] s = { "CONFIRM_DELETE" };
                RegisterClientScriptBlock("confirmDelete", PortalSettings.GetStringResource("Rainbow.aspnet_client.Rainbow_scripts.confirmDelete.js", s));
            }

            base.OnInit(e);
        }
コード例 #3
0
        /// <summary>
        /// Raises the Init event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param>
        protected override void OnInit(EventArgs e)
        {
            this.saveButton.Click   += new EventHandler(this.SaveButton_Click);
            this.CancelButton.Click += new EventHandler(this.cancelButton_Click);
            this.Load += new EventHandler(this.Page_Load);

            //Confirm delete
            if (!(ClientScript.IsClientScriptBlockRegistered("confirmDelete")))
            {
                string[] s = { "CONFIRM_DELETE" };
                ClientScript.RegisterClientScriptBlock(this.GetType(), "confirmDelete",
                                                       PortalSettings.GetStringResource(
                                                           "CONFIRM_DELETE_SCRIPT", s));
            }

            base.OnInit(e);
        }
コード例 #4
0
        /// <summary>
        /// Raises the Init event.
        /// </summary>
        /// <param name="e"></param>
        override protected void OnInit(EventArgs e)
        {
            InitializeComponent();

            //Confirm delete
            if (!(IsClientScriptBlockRegistered("confirmDelete")))
            {
                string[] s = { "CONFIRM_DELETE" };
                RegisterClientScriptBlock("confirmDelete", PortalSettings.GetStringResource("Rainbow.aspnet_client.Rainbow_scripts.confirmDelete.js", s));
            }

            LeftDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");
            RightDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");
            ContentDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");

            base.OnInit(e);
        }
コード例 #5
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        protected override void OnInit(EventArgs e)
        {
            if (!(this.Page.ClientScript.IsClientScriptBlockRegistered("confirmDelete")))
            {
                string[] s = { "CONFIRM_DELETE" };
                this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "confirmDelete",
                                                                 PortalSettings.GetStringResource(
                                                                     "CONFIRM_DELETE_SCRIPT",
                                                                     s));
            }

            if (topDeleteButton.Attributes["onclick"] != null)
            {
                topDeleteButton.Attributes["onclick"] = "return confirmDelete();" +
                                                        topDeleteButton.Attributes["onclick"];
            }
            else
            {
                topDeleteButton.Attributes.Add("onclick", "return confirmDelete();");
            }

            if (bottomDeleteButton.Attributes["onclick"] != null)
            {
                bottomDeleteButton.Attributes["onclick"] = "return confirmDelete();" +
                                                           bottomDeleteButton.Attributes["onclick"];
            }
            else
            {
                bottomDeleteButton.Attributes.Add("onclick", "return confirmDelete();");
            }

            this.topUpdateButton.Click    += new EventHandler(this.UpdateButton_Click);
            this.topCancelButton.Click    += new EventHandler(this.CancelButton_Click);
            this.topDeleteButton.Click    += new EventHandler(this.DeleteButton_Click);
            this.bottomUpdateButton.Click += new EventHandler(this.UpdateButton_Click);
            this.bottomCancelButton.Click += new EventHandler(this.CancelButton_Click);
            this.bottomDeleteButton.Click += new EventHandler(this.DeleteButton_Click);
            this.Load += new EventHandler(this.Page_Load);

            base.OnInit(e);
        }
コード例 #6
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load"/> event.
        /// </summary>
        /// <param name="e">
        /// The <see cref="T:System.EventArgs"/> object that contains the event data.
        /// </param>
        /// <remarks>
        /// </remarks>
        protected override void OnLoad(EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                // Invalidate settings cache
                if (CurrentCache.Exists(Key.TabSettings(this.PageID)))
                {
                    CurrentCache.Remove(Key.TabSettings(this.PageID));
                }
            }

            base.OnLoad(e);

            // Confirm delete
            if (!this.ClientScript.IsClientScriptBlockRegistered("confirmDelete"))
            {
                string[] s = { "CONFIRM_DELETE" };
                this.ClientScript.RegisterClientScriptBlock(
                    this.GetType(), "confirmDelete", PortalSettings.GetStringResource("CONFIRM_DELETE_SCRIPT", s));
            }

            //this.TopDeleteBtn.Attributes.Add("00", "return confirmDelete()");
            //this.LeftDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");
            //this.RightDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");
            //this.ContentDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");
            //this.BottomDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");
            urlToLoadModules = "'" + HttpUrlBuilder.BuildUrl("~/Appleseed.Core/PageLayout/LoadModule") + "'";
            // If first visit to the page, update all entries
            if (!this.Page.IsPostBack)
            {
                this.msgError.Visible = false;

                this.BindData();

                this.SetSecurityAccess();


                // 2/27/2003 Start - Ender Malkoc
                // After up or down button when the page is refreshed, select the previously selected
                // tab from the list.
                if (this.Request.Params["selectedmodid"] != null)
                {
                    try
                    {
                        var modIndex = Int32.Parse(this.Request.Params["selectedmodid"]);
                        //this.SelectModule(this.topPane, this.GetModules("TopPane"), modIndex);
                        //this.SelectModule(this.leftPane, this.GetModules("LeftPane"), modIndex);
                        //this.SelectModule(this.contentPane, this.GetModules("ContentPane"), modIndex);
                        //this.SelectModule(this.rightPane, this.GetModules("RightPane"), modIndex);
                        //this.SelectModule(this.bottomPane, this.GetModules("BottomPane"), modIndex);
                    }
                    catch (Exception ex)
                    {
                        ErrorHandler.Publish(
                            LogLevel.Error,
                            "After up or down button when the page is refreshed, select the previously selected tab from the list.",
                            ex);
                    }
                }

                // 2/27/2003 end - Ender Malkoc
            }

            // Binds custom settings to table
            this.EditTable.DataSource = new SortedList(this.PageSettings);
            this.EditTable.DataBind();

            this.ModuleIdField.Value = this.ModuleID.ToString();
            this.PageIdField.Value   = this.PageID.ToString();
        }
コード例 #7
0
        /// <summary>
        /// Handles the OnInit event at Page level<br/>
        /// Performs OnInit events that are common to all Pages<br/>
        /// Can be overridden
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param>
        protected override void OnInit(EventArgs e)
        {
            LoadSettings();

            //if (cancelButton != null)
            Control myControl = null;

            if (cancelButton != null || (myControl = Page.FindControl("cancelButton")) != null)

            //if ((myControl=Page.FindControl("cancelButton")) != null)
            {
                if (cancelButton == null)
                {
                    cancelButton = (System.Web.UI.WebControls.LinkButton)myControl;
                }

                cancelButton.Click           += new EventHandler(CancelBtn_Click);
                cancelButton.Text             = General.GetString("CANCEL", "Cancel");
                cancelButton.CausesValidation = false;
                cancelButton.EnableViewState  = false;
            }
            //if (updateButton != null)
            if (updateButton != null || (myControl = Page.FindControl("updateButton")) != null)
            {
                if (updateButton == null)
                {
                    updateButton = (System.Web.UI.WebControls.LinkButton)myControl;
                }

                updateButton.Click          += new EventHandler(UpdateBtn_Click);
                updateButton.Text            = General.GetString("APPLY", "Apply", updateButton);
                updateButton.EnableViewState = false;
            }
            //if (deleteButton != null)
            if (deleteButton != null || (myControl = Page.FindControl("deleteButton")) != null)
            {
                if (deleteButton == null)
                {
                    deleteButton = (System.Web.UI.WebControls.LinkButton)myControl;
                }

                deleteButton.Click          += new EventHandler(DeleteBtn_Click);
                deleteButton.Text            = General.GetString("DELETE", "Delete", deleteButton);
                deleteButton.EnableViewState = false;

                // Assign current permissions to Delete button
                if (PortalSecurity.HasDeletePermissions(ModuleID) == false)
                {
                    deleteButton.Visible = false;
                }
                else
                {
                    if (!(ClientScript.IsClientScriptBlockRegistered("confirmDelete")))
                    {
                        string[] s = { "CONFIRM_DELETE" };
                        ClientScript.RegisterClientScriptBlock(GetType(), "confirmDelete",
                                                               PortalSettings.GetStringResource(
                                                                   "CONFIRM_DELETE_SCRIPT",
                                                                   s));
                    }
                    deleteButton.Attributes.Add("OnClick", "return confirmDelete()");
                }
            }
            ModuleGuidInCookie();

            base.OnInit(e);
        }
コード例 #8
0
        /// <summary>
        /// The Page_Load server event handler on this page is used
        /// to populate a tab's layout settings on the page
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            //Confirm delete
            if (!(ClientScript.IsClientScriptBlockRegistered("confirmDelete")))
            {
                string[] s = { "CONFIRM_DELETE" };
                ClientScript.RegisterClientScriptBlock(this.GetType(), "confirmDelete",
                                                       PortalSettings.GetStringResource(
                                                           "CONFIRM_DELETE_SCRIPT", s));
            }

            LeftDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");
            RightDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");
            ContentDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");

            // If first visit to the page, update all entries
            if (!Page.IsPostBack)
            {
                msgError.Visible = false;

                // Set images for buttons from current theme
                LeftUpBtn.ImageUrl     = CurrentTheme.GetImage("Buttons_Up", "Up.gif").ImageUrl;
                LeftRightBtn.ImageUrl  = CurrentTheme.GetImage("Buttons_Right", "Right.gif").ImageUrl;
                LeftDownBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Down", "Down.gif").ImageUrl;
                LeftEditBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Edit", "Edit.gif").ImageUrl;
                LeftDeleteBtn.ImageUrl = CurrentTheme.GetImage("Buttons_Delete", "Delete.gif").ImageUrl;

                ContentUpBtn.ImageUrl     = CurrentTheme.GetImage("Buttons_Up", "Up.gif").ImageUrl;
                ContentLeftBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Left", "Left.gif").ImageUrl;
                ContentRightBtn.ImageUrl  = CurrentTheme.GetImage("Buttons_Right", "Right.gif").ImageUrl;
                ContentDownBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Down", "Down.gif").ImageUrl;
                ContentEditBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Edit", "Edit.gif").ImageUrl;
                ContentDeleteBtn.ImageUrl = CurrentTheme.GetImage("Buttons_Delete", "Delete.gif").ImageUrl;

                RightUpBtn.ImageUrl     = CurrentTheme.GetImage("Buttons_Up", "Up.gif").ImageUrl;
                RightLeftBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Left", "Left.gif").ImageUrl;
                RightDownBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Down", "Down.gif").ImageUrl;
                RightEditBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Edit", "Edit.gif").ImageUrl;
                RightDeleteBtn.ImageUrl = CurrentTheme.GetImage("Buttons_Delete", "Delete.gif").ImageUrl;

                BindData();

                SetSecurityAccess();

                // 2/27/2003 Start - Ender Malkoc
                // After up or down button when the page is refreshed, select the previously selected
                // tab from the list.
                if (Request.Params["selectedmodid"] != null)
                {
                    try {
                        int modIndex = Int32.Parse(Request.Params["selectedmodid"]);
                        SelectModule(leftPane, GetModules("LeftPane"), modIndex);
                        SelectModule(contentPane, GetModules("ContentPane"), modIndex);
                        SelectModule(rightPane, GetModules("RightPane"), modIndex);
                    }
                    catch (Exception ex) {
                        ErrorHandler.Publish(LogLevel.Error,
                                             "After up or down button when the page is refreshed, select the previously selected tab from the list.",
                                             ex);
                    }
                }
                // 2/27/2003 end - Ender Malkoc
            }
            // Binds custom settings to table
            EditTable.DataSource = new SortedList(pageSettings);
            EditTable.DataBind();
        }