Ejemplo n.º 1
0
        public void btnDeleteChecked_Click(object sender, EventArgs e)
        {
            // Loads delete confirmation control
            deleteconfirm ucDelConfirm = (deleteconfirm)LoadControl("/deleteconfirm.ascx");             // Load delete confirmation control

            ucDelConfirm.ID         = "ucDelConfirm";
            ucDelConfirm.DeleteType = "multi";                                                          // Set deletion type to multiple
            this.pnlDeleteConfirm.ContentTemplateContainer.Controls.Clear();                            // Clear content of delete confirmation update panel, if any
            this.pnlDeleteConfirm.ContentTemplateContainer.Controls.Add(ucDelConfirm);                  // Add delete confirmation control to update panel

            // Assign event handlers
            ucDelConfirm.confirmed += new CommandEventHandler(DeleteConfirmed);
            ucDelConfirm.cancelled += new Action(RemoveDeleteConfirmation);
        }
        public void Delete_Click(object sender, CommandEventArgs e)
        {
            // Loads delete confirmation control
            Session["delRxNo"] = e.CommandArgument.ToString();                                          // Store Rx No. of record to be deleted
            deleteconfirm ucDelConfirm = (deleteconfirm)LoadControl("/deleteconfirm.ascx");             // Load delete confirmation control

            ucDelConfirm.ID         = "ucDelConfirm";
            ucDelConfirm.DeleteType = "single";                                                                 // Set deletion type to single
            this.pnlDeleteConfirm.ContentTemplateContainer.Controls.Clear();                                    // Clear content of delete confirmation update panel, if any
            this.pnlDeleteConfirm.ContentTemplateContainer.Controls.Add(ucDelConfirm);                          // Add delete confirmation control to update panel

            // Assign event handlers
            ucDelConfirm.confirmed += new CommandEventHandler(DeleteConfirmed);
            ucDelConfirm.cancelled += new Action(RemoveDeleteConfirmation);
        }