protected void PendingGridView() { using (PTCLEntities db = new PTCLEntities()) { var UserID = Convert.ToInt32(Session["UserID"]); //change bad ma var PendingComplaintsData = db.UserPendingComplaints(UserID).ToList(); GVPendingComplaint.DataSource = PendingComplaintsData; GVPendingComplaint.DataBind(); var totalCount = db.GetMyComplaints(UserID).ToList(); int count = totalCount.Count; if (count > 10) { Response.Write("Limit Exceed"); RegisterComplaintSection.CssClass = " d-none"; PanelOverLimit.CssClass = " "; } } }