protected void Page_Load(object sender, EventArgs e) { try { var countryCont = new CountryController(); string CountryIdQS = Request.QueryString["CountryID"]; //Load Model in to "Universal Variable" var country = countryCont.GetCountry(CountryIdQS); //Layout the Data MainTitle.InnerText = country.Name; //Load Flag DetailsFlag.Attributes.Add("class", "img-responsive center-block flag flag-icon-background flag-icon-" + country.Code2.ToLower()); //Load the Map (Had to use Literal as editing Iframe src caused errors due to Framework version??? CountryMap.Text = @"<iframe id='CountryMap' runat='server' width='100%' height='450' src='https://www.google.com/maps/embed/v1/place?q=" + country.Name + "&key=AIzaSyDHPO6bNG225SK_Jnohf4xQtC-1Ew4V-Ec'></iframe>"; //Load the Popular Cities into the Repeater var citiesCont = new CityController(); var CountryCities = citiesCont.GetCountryCities(country.Code); rptCities.DataSource = CountryCities; rptCities.DataBind(); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
public void LoadCountries(string sortValue, bool LowestFirst) { //New "Countries" Code by AB var countryCont = new CountryController(); rptItemList.DataSource = countryCont.GetCountriesSorted(sortValue, LowestFirst); rptItemList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { var countryCont = new CountryController(); string searchQuery = Request.QueryString["Query"]; rptResults.DataSource = countryCont.SearchForCountries(searchQuery); rptResults.DataBind(); }