Exemple #1
0
    /// <summary>
    /// Event handler for Page_Load event
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        DisplayForm();
        pnlImage.Visible = false;
        pnlPost.Visible  = false;
        lbImages.Text    = "";
        lbPosts.Text     = "";


        if (!IsPostBack)
        {
            loadCityLists();
            loadCountryList();

            if (QueryStringVerifier.IsValidISOAndIsNotNull(Request.QueryString["Cont"]))
            {
                _TICollection.FetchForContinent(Request.QueryString["Cont"], radImageAscend.Checked);
                gvImage.DataSource = _TICollection;
                gvImage.DataBind();
                pnlImage.Visible = true;
            }
            else if (QueryStringVerifier.IsNotNull(Request.QueryString["search"]))
            {
                txtSearch.Text = Request.QueryString["search"];
                FetchSearchResults();
            }
        }
        else if (txtSearch.Text != "" || ((radCity.Checked || radCountry.Checked) && radByImage.Checked))
        {
            FetchSearchResults();
        }
    }
Exemple #2
0
    /// <summary>
    /// Event handler for page_load event
    /// </summary>
    /// <param name="sender">a sender</param>
    /// <param name="e">a e</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (QueryStringVerifier.IsValidISOAndIsNotNull(Request.QueryString["Id"]))
            {
                string iso = Request.QueryString["Id"];
                LoadCountry(iso);

                if (_geoCountry.Count > 0)
                {
                    DisplayCountry();

                    if (_geoCountry[0].ImageCollection.Count > 0)
                    {
                        // Display images area if images
                        DisplayRelatedImage();
                    }
                    else
                    {
                        // Hide images area if no images
                        pnlImages.Visible = false;
                    }
                }
            }
            else
            {
                Response.Redirect("Error.aspx");
            }
        }
    }