private void GetMasterList(string Type, DropDownList DrpList) { try { ClsMaster ClsMas = new ClsMaster(); DataTable DT = new DataTable(); DT = ClsMas.GetMaster(Type, Session["Id"].ToString()); DrpList.DataSource = DT; DrpList.DataValueField = "ID"; DrpList.DataTextField = "NAME"; DrpList.DataBind(); } catch (Exception Ex) { } }
//binding Supplier Dropdown private void bindSupplier(string Type, DropDownList DrpList) { try { DataTable DT = new DataTable(); DrpList.Items.Clear(); DT = ClsMas.GetMaster(Type, Session["Id"].ToString()); DrpList.DataSource = DT; DrpList.DataValueField = "ID"; DrpList.DataTextField = "NAME"; DrpList.DataBind(); DrpList.Items.Insert(0, new ListItem("-----Select---", "0")); } catch (Exception Ex) { } }