protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { Place pl = new Place(); pll = pl.GetAllPlaces(); DDLPlaces.Items.Clear(); DDLPlaces.Items.Insert(0, new ListItem("--Select--", "0")); DDLPlaces.AppendDataBoundItems = true; DDLPlaces.DataTextField = "PName"; DDLPlaces.DataValueField = "PlId"; DDLPlaces.DataSource = pll; DDLPlaces.DataBind(); Place ppl = new Place(); rll = ppl.GetTop3Rating(); DatalistRating.DataSource = rll; DatalistRating.DataBind(); if (Session["ItinId"] != null) { int id = Convert.ToInt32(Session["ItinId"]); Itinerary ii = new Itinerary(); ii = ii.selectbyidd(id); if (ii != null) { NameTB.Text = ii.IName; DDLPlaces.SelectedValue = ii.PlId.ToString(); } else { Response.Redirect("TimeAndDate.aspx"); } } } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { //CalendarDate.Visible = false; Place pl = new Place(); pll = pl.GetAllPlaces(); DDLPlaces.Items.Clear(); DDLPlaces.Items.Insert(0, new ListItem("--Select--", "0")); DDLPlaces.AppendDataBoundItems = true; DDLPlaces.DataTextField = "PName"; DDLPlaces.DataValueField = "PlId"; DDLPlaces.DataSource = pll; DDLPlaces.DataBind(); Place ppl = new Place(); rll = ppl.GetTop3Rating(); DatalistRating.DataSource = rll; DatalistRating.DataBind(); } }