protected void Page_Load(object sender, EventArgs e) { SqlDataReader drProducts = DataProvider.GetProductList(Session["UserSystemId"].ToString()); DropDownListProducts.DataValueField = "PRDCT_ID"; DropDownListProducts.DataTextField = "PRDCT_CODE-PRDCT_NAME"; DropDownListProducts.DataSource = drProducts; DropDownListProducts.DataBind(); drProducts.Close(); }
protected void LoadDropDownListProducts() { ProductsCS prod = new ProductsCS(); DropDownListProducts.DataSource = prod.GetProducts(); DropDownListProducts.DataValueField = "ProductID"; DropDownListProducts.DataTextField = "ProductName"; DropDownListProducts.DataBind(); }
private void GetProducts() { SqlDataReader drProducts = DataProvider.GetProductList(Session["UserSystemId"].ToString()); DropDownListProducts.DataValueField = "PRDCT_ID"; DropDownListProducts.DataTextField = "PRDCT_CODE-PRDCT_NAME"; DropDownListProducts.DataSource = drProducts; DropDownListProducts.DataBind(); drProducts.Close(); if (Session["SelectedProduct"] != null) { DataController.SetAsSeletedValue(DropDownListProducts, Session["SelectedProduct"].ToString(), true); } else { if (DropDownListProducts.Items.Count > 0) { Session["SelectedProduct"] = DropDownListProducts.Items[0].Value; } } }
/// <summary> /// Method that get called on Selecting Products DropDownList /// </summary> /// <param name="sender">Event Source</param> /// <param name="e">Event Data</param> protected void DropDownListProducts_SelectedIndexChanged(object sender, EventArgs e) { SetRole(); PanelActionMessage.Visible = false; DropDownListProducts.Focus(); }