protected void btnSave_OnClick(object sender, System.EventArgs e)
    {
        Page.Validate("form");

        if (Page.IsValid)
        {

            int user_id = Convert.ToInt32(Context.Items["UserID"]);

            if (!String.IsNullOrEmpty(Request.QueryString["spaceCategoryID"]))
            {
                space_category_id = Convert.ToInt32(Request.QueryString["spaceCategoryID"]);
                qSoc_SpaceCategory category = new qSoc_SpaceCategory(space_category_id);

                category.CatgoryName = txtSpaceCategory.Text;
                category.CategoryDescription = txtDescription.Text;
                category.Available = rblAvailable.SelectedValue;
                category.LastModified = DateTime.Now;
                category.LastModifiedBy = user_id;
                category.Update();
            }
            else
            {
                qSoc_SpaceCategory category = new qSoc_SpaceCategory();
                category.ScopeID = 1;
                category.Created = DateTime.Now;
                category.CreatedBy = user_id;
                category.LastModified = DateTime.Now;
                category.LastModifiedBy = user_id;
                category.Available = "Yes";
                category.MarkAsDelete = 0;
                category.CatgoryName = txtSpaceCategory.Text;
                category.CategoryDescription = txtDescription.Text;
                category.Available = rblAvailable.SelectedValue;
                category.Insert();

                space_category_id = category.SpaceCategoryID;
            }

            // redirect to page to add keyword + keywords
            if (!String.IsNullOrEmpty(Request.QueryString["spaceCategoryID"]))
            {
                //lblMessage.Text = "*** Record Successfully Updated ***";
                //lblMessageBottom.Text = "*** Record Successfully Updated ***";
                Response.Redirect("group-types-list.aspx");
            }
            else
            {
                Response.Redirect(Request.Url.ToString() + "?mode=add-successful&spaceCategoryID=" + space_category_id);
                //Response.Redirect("keywords-list.aspx");
            }
        }
    }