예제 #1
0
    //Handle add new category
    public void Add_Category(Object s, EventArgs e)
    {
        //Instantiate article delete object
        ArticleCategory AddCat = new ArticleCategory();

        AddCat.Category = Request.Form["CategoryName"];

        Caching.PurgeCacheItems("ArticleCategory_SideMenu");

        //Notify user if error occured.
        if (AddCat.Add() != 0)
        {
            JSLiteral.Text = "Error occured while processing your submit.";
            return;
        }

        Response.Redirect("confirmarticlecatedit.aspx?catname=" + AddCat.Category + "&mode=add");
    }