Exemplo n.º 1
0
        protected void btnCategoryDelete_Click(object sender, EventArgs e)
        {
            Kategori k = new Kategori();

            k.Id = Convert.ToInt16(DropDownListCategories.SelectedItem.Value);
            KategoriDb db = new KategoriDb();

            try
            {
                db.Delete(k);
            }
            catch (Exception hata)
            {
                Label_ErrorDelete.Visible = true;
                Label_ErrorDelete.Text    = hata.Message.ToString();
            }
            CategoryListShow();
            Response.Redirect(HttpContext.Current.Request.Url.ToString(), true);
        }