예제 #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();
        }
    }
예제 #2
0
    protected void btnBrowseCriteria_Click(object sender, EventArgs e)
    {
        TravelImageCollection col = new TravelImageCollection();

        if (rbContinent.Checked)
        {
            col.FetchForContinent(Convert.ToString(ddlBrowseCriteria.SelectedValue), true);
        }

        if (rbCountry.Checked)
        {
            col.FetchForCountry(Convert.ToString(ddlBrowseCriteria.SelectedValue), true);
        }

        gvImage.DataSource = col;
        gvImage.DataBind();
    }