protected void Page_Load(object sender, EventArgs e) { if (Session["tourist_id"] != null) { LoadData(int.Parse(Session["tourist_id"].ToString())); if (!Page.IsPostBack) { AttractionDAO attractions = new AttractionDAO(); foreach (var i in attractions.SelectAll().OrderBy(a => a.Name).ToList()) { DropDownListAttractions.Items.Add(new ListItem(i.Name, i.Id.ToString())); } DropDownListAttractions.DataBind(); } } else if (Session["tourguide_id"] != null) { Response.Redirect("Index.aspx"); } else { Response.Redirect("Login.aspx"); } }
// public List <Attraction> ListAttractionAll()// un-filter, popular arrange { AttractionDAO dao = new AttractionDAO(); return(dao.SelectAll()); }