protected void Save_Click(Object sender, EventArgs e)
 {
     StoryCategories _cat = new StoryCategories(this.ConnectionString);
     _cat.Description = txt_Description.Text;
     if (!_cat.Save())
     {
         lbl_Error.Text = "An unexpected error has occurred. Please try again.";
     }
     else
     {
         lbl_Error.Text = "";
         txt_Description.Text = "";
         BindData();
     }
 }
 protected void Category_OnUpdateCommand(Object sender, DataGridCommandEventArgs e)
 {
     StoryCategories _cat = new StoryCategories(this.ConnectionString);
     String _id = dg_category.DataKeys[e.Item.ItemIndex].ToString();
     _cat.ID = _id;
     _cat.Description = ((TextBox)e.Item.FindControl("txt_Desc")).Text;
     _cat.Sort = Convert.ToInt32(((TextBox)e.Item.FindControl("txt_Sort")).Text);
     if (!_cat.Save())
     {
         lbl_Error.Text = "An unexpected error has occurred. Please try again.";
     }
     else
     {
         lbl_Error.Text = "";
         dg_category.EditItemIndex = -1;
         val_Desc.Enabled = true;
         BindData();
     }
 }