protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //Set Dropdown ProductType_ddl.DataSource = ProductTypeHandler.GetProductTypes(); ProductType_ddl.DataTextField = "Name"; ProductType_ddl.DataValueField = "ID"; ProductType_ddl.SelectedIndex = -1; ProductType_ddl.DataBind(); ProductType_ddl.Items.Insert(0, new ListItem("--Select Product Type--", "-1")); //fill data in repeater RptProductListByType.DataSource = new ProductHandler().GetAllProduct(); RptProductListByType.DataBind(); } //jika admin if (Session.Keys.Count != 0) { if (Session["RoleID"].ToString().Equals("1")) { Btn_InsertNewProd.Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //ProductType_ddl.DataSource = ProductHandler ProductType_ddl.DataSource = ProductTypeHandler.GetProductTypes(); ProductType_ddl.DataTextField = "Name"; ProductType_ddl.DataValueField = "ID"; ProductType_ddl.SelectedIndex = 0; ProductType_ddl.DataBind(); //ProductType_ddl.Items.Insert(0, new ListItem("--Select Item Product--", "-1")); } }