protected void addCate_Click(object sender, EventArgs e) { if (ck.checkstringnull(tbCate.Text)) { if (ck.checkstring(tbCate.Text, 50)) { if (cl.checkalcate(tbCate.Text.Trim())) { ca = new category_name(); ca.cat_name = tbCate.Text.Trim(); cl.AddCate(ca); loadCate(); clearall(); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('The Category Name Already Exist')", true); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('The Category Name Too Long')", true); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Please Type Category')", true); } }