protected void GetAgentName() { Lag = objagBL.GetAllAgents(at).ToList(); foreach (var cnt in Lag) { ListItem li = new ListItem(); li.Text = cnt.AgencyName; li.Value = cnt.AgentID.ToString(); DDLAgency.Items.Add(li); } }
//protected override void OnLoad(EventArgs e) //{ // base.OnLoad(e); //} protected void GetAgents() { Agentstbl ags = new Agentstbl(); List <Agentstbl> lstags = new List <Agentstbl>(); RegistrationBL objRegBL = new RegistrationBL(); lstags = objRegBL.GetAllAgents(ags).ToList(); ddlAgency.Items.Clear(); ddlAgency.Items.Add(new ListItem("--Select--", "0")); foreach (var ag in lstags) { ddlAgency.Items.Add(new ListItem(ag.AgencyName, ag.AgentID.ToString())); } }
protected void GetAgency() { List <Agentstbl> lstAgents = new List <Agentstbl>(); Agentstbl agt = new Agentstbl(); RegistrationBL objRegBL = new RegistrationBL(); lstAgents = objRegBL.GetAllAgents(agt).ToList(); ddlAgency.Items.Clear(); foreach (var el in lstAgents) { ListItem li = new ListItem(); li.Text = el.AgencyName; li.Value = el.AgentID.ToString(); ddlAgency.Items.Add(li); } }