Esempio n. 1
0
 public ActionResult Create(Category category)
 {
     if (!ModelState.IsValid)
     {
         return(View(category));
     }
     db.AddCategory(category);
     return(RedirectToAction("Index"));
 }
        protected void AddCategory_OnClick(object sender, EventArgs e)
        {
            var res = DbManager.AddCategory(TxtKategoriAdi.Text);

            if (res.Success)
            {
                Application["Info"] = res.Message;
                Response.Redirect("Categories.aspx");
                Context.ApplicationInstance.CompleteRequest();
            }
            else
            {
                InfoLabel(res.Message);
            }
        }