protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { Response.Redirect("Login.aspx"); } if (!IsPostBack) { busThick buscat = new busThick(); DataTable dt = new DataTable("User"); dt = buscat.allCategories(); GridView1.DataSource = dt; GridView1.DataBind(); } }
protected void btnSave_Click(object sender, EventArgs e) { busThick buscat = new busThick(); FrameWork.Thick frmcat = new FrameWork.Thick(); frmcat.Thickness = this.txtCategory.Text; isExisting = isUserExisting(); if (isExisting.Equals(true)) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Width existing')", true); } else { buscat.insertCategory(frmcat); } DataTable dt = new DataTable("User"); dt = buscat.allCategories(); GridView1.DataSource = dt; GridView1.DataBind(); }