protected void Page_Load(object sender, EventArgs e) { /* if (Session["userid"] == null || Session["userid"].ToString().Length <= 0) * { * Server.Transfer("/Trinkets/ErrorPage.aspx?msg=401&handler=customErrors%20section%20-%20Web.config"); * } * else if (Session["admin"] != null && !Boolean.Parse(Session["admin"].ToString())) * { * Server.Transfer("/Trinkets/ErrorPage.aspx?msg=403&handler=customErrors%20section%20-%20Web.config"); * } * else * {*/ if (!IsPostBack) { DataSet ds = typebll.GetAllCategories(); Category.DataSource = ds; Category.DataTextField = "Name"; Category.DataValueField = "TypeId"; Category.DataBind(); } else { this.BindGrid(); } // } }