显示搜索文本一页到另一页的问题 [英] display search texts one page to another page problem

查看:73
本文介绍了显示搜索文本一页到另一页的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

我在搜索引擎中有2个文本框和2个下拉列表,分别是城市,年份,功能区和行业,

现在,我希望结果显示在第二页中,并使用搜索选项.

所以我使用代码

hi friends,

I have 2 textboxes and 2 dropdowns namely city,year,fuctional area and industry in search engine,

now i want the result displayed in second page with search option used.

so i use the code

if (txtCity.Text == "" && ddfarea.SelectedIndex == 0 && ddyear.SelectedIndex == 0 && TextBox1.Text == "")
      {
          lblmsg.Text = "Please Select Any Of One";
      }
      else if (txtCity.Text != "" && ddyear.SelectedIndex == 0 && ddfarea.SelectedIndex == 0 && TextBox1.Text == "")
      {
          Response.Redirect("~//searchpage.aspx?loc=" + txtCity.Text + "");
      }

      else if (ddyear.SelectedIndex > 0 && txtCity.Text == "" && ddfarea.SelectedIndex == 0 && TextBox1.Text == "")
      {
          Response.Redirect("~//searchpage.aspx?exp=" + ddyear.SelectedItem.Text + "");
      }
      else if (txtCity.Text == "" && ddfarea.SelectedIndex >0 && ddyear.SelectedIndex == 0 && TextBox1.Text == "")
      {
          Response.Redirect("~//searchpage.aspx?fun=" + ddfarea.SelectedItem.Text + "");
      }
      else if (txtCity.Text != "" && ddyear.SelectedIndex > 0 && ddfarea.SelectedIndex == 0 && TextBox1.Text == "")
      {
          Response.Redirect("~//searchpage.aspx?loc=" + txtCity.Text + " && ~//searchpage.aspx?exp=" + ddyear.SelectedItem.Text + "");
      }




但它仅适用于仅选择年份或仅选择城市的单一条件,

但是条件如选择城市和年份




but its working for only single conditions selecting only year or selecting only city,

but condition for two like selecting city and year

else if (txtCity.Text != "" && ddyear.SelectedIndex > 0 && ddfarea.SelectedIndex == 0 && TextBox1.Text == "")
        {
            Response.Redirect("~//searchpage.aspx?loc=" + txtCity.Text + " && ~//searchpage.aspx?exp=" + ddyear.SelectedItem.Text + "");
        }




不起作用,此代码无法填充城市和年份文本框并在另一页中添加下拉列表,并且它仅针对不适合(城市和年份)的城市提供结果

所以请帮我解决这个问题?




is not working , this code not fill the city and year textboxe and dropdown in another page also it gives result only for city not for (city and year)

so please help me to solve this problem?

推荐答案

删除后续项目的页面引用:
Remove the page reference on subsequent items:
Response.Redirect("~//searchpage.aspx?loc=" + txtCity.Text + "&&exp=" + ddyear.SelectedItem.Text + "");


这篇关于显示搜索文本一页到另一页的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆