protected void Button1_Click(object sender, EventArgs e) { anm_Utility ut = new anm_Utility(); if (CheckBox1.Checked) { int idfather = Convert.ToInt32(DropDownList1.SelectedValue.ToString()); string idrootcat = ut.GetIdcRoot(idfather.ToString()); if (idrootcat == "0" || idrootcat == null || idrootcat == "") { idrootcat = idfather.ToString(); } ut.AddCategory(TextBox1.Text.ToString(), idfather, ut.GetOrderCat(idfather) + 1, idrootcat); } else { ut.AddCategory(TextBox1.Text.ToString(), 0, ut.GetOrderCat(0) + 1, "0"); } Response.Redirect(Page.Request.Url.AbsolutePath.ToString() + "?p=AdminCategories"); }