Beispiel #1
0
        //*******************************************************
        //
        // The DeleteBtn_Click server event handler on this page is
        // used to delete an portal module from the page
        //
        //*******************************************************

        private void DeleteBtn_Click(Object sender, ImageClickEventArgs e)
        {
            String    pane     = ((ImageButton)sender).CommandArgument;
            ListBox   _listbox = (ListBox)Page.FindControl(pane);
            ArrayList modules  = GetModules(pane);

            if (_listbox.SelectedIndex != -1)
            {
                ModuleItem m = (ModuleItem)modules[_listbox.SelectedIndex];
                if (m.ModuleId > -1)
                {
                    // must delete from database too
                    AdminDB admin = new AdminDB();
                    admin.DeleteModule(m.ModuleId);
                }
            }

            // Redirect to the same page to pick up changes
            Response.Redirect(Request.RawUrl);
        }