protected void Page_Load(object sender, EventArgs e) { User user = (User)Session["User"]; if ((User)Session["User"] == null || user.Role != 1) { Response.Redirect("/Welcome.aspx"); } //Populating a DataTable from database DataTable dt = dataUser.tableUser(); GridView1.DataSource = dt; GridView1.DataBind(); }