protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BulletedList1.Items.Clear(); AirService airService = new AirService(); if (Application["Allairways"] == null) Application["Allairways"] = airService.GetAllAirLines(); DataSet ds = (DataSet)(Application["Allairways"]); if(ds != null && ds.Tables.Count > 0 && ds.Tables[0].DefaultView != null) for (int i = 0; i < ds.Tables[0].DefaultView.Count; i++) BulletedList1.Items.Add(new ListItem(ds.Tables[0].Rows[i][0].ToString(), "javascript:IntxtAirline('" + ds.Tables[0].Rows[i][1].ToString() + "');")); } }
private void InitAirline() { AirService airService = new AirService(); if (Application["Allairways"] == null) { Application["Allairways"] = airService.GetAllAirLines(); } DataSet ds = (DataSet)(Application["Allairways"]); for (int i = 0; i < ds.Tables[0].DefaultView.Count; i++) { BulletedList1.Items.Add(new ListItem(ds.Tables[0].Rows[i][0].ToString(), "javascript:IntxtAirline('" + txtAirline.ClientID + "','" + ds.Tables[0].Rows[i][1].ToString() + "');")); } }