protected void btnDepartment_Click(object sender, EventArgs e) { try { DepMst mst = new DepMst(); mst.Dept_Name = txtdepartmentname.Text.Trim(); DepMsts obj = new DepMsts(); String strerr = obj.CreateDep(mst); if (strerr == "0") { Response.Redirect("~/Department/DepDetails", false); } } catch (Exception ex) { } }