Skip to content

Search with Dropdownlist

Ekrem Tapan

Ekrem Tapan

Asked Nov 8, 2015, 11:59 PM EST1 answer
Share
LinkedInX
hi everyone, im maintaince a one webportal,
 
but i dont know this part how to fix 
 im posted code below, now on system just use a one date search, but i wantto use 2 dropdownlist lstYear and FirstYear ddlist, i wantto search between FirstYear  and LastYear, how can i do it ?
 
C#
protected void btnSearch_Click(object sender, EventArgs e)
    {
        DocHelper.SearchConds conds = new DocHelper.SearchConds();

        conds.Year = ConvertLib.ToInt(this.lstYear.SelectedValue, DefVal.Int);
        conds.Keyword = this.txtKeyword.Text.Trim();

        List<ISystemId> countrySIds = new List<ISystemId>();
        foreach (var block in this._countryAreaBlocks)
        {
            countrySIds.AddRange(block.GetSeledCountrySIds());
        }
        conds.CountrySIds = countrySIds.ToArray();

        List<ISystemId> territorySIds = new List<ISystemId>();
        foreach (var block in this._territoryBlocks)
        {
            if (block.Checked)
            {
                territorySIds.Add(block.SId);
            }
        }
        conds.TerritorySIds = territorySIds.ToArray();

        Session[SessionDefine.SearchConds] = conds;

        Response.Redirect(string.Format("{0}doc/index.aspx", SystemDefine.WebSiteRoot));
    }

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 1 short reply
    • Ekrem Tapan
      0
      Problem is solved!
      0