URL参数搜索
2007-10-12 13:57
267 查看
1,构造URL搜索参数
string strSearch = string.Empty;
if (this.dropDistrict.SelectedIndex != 0)
{
strSearch += String.Format("{0} = '{1}'",( user.userID.Substring(0,6) == "230000") ? "City" : "District",dropDistrict.SelectedValue);
}
if (DropFQualiClassID.SelectedValue != "0")
{
strSearch += String.Format(" AND FQualiClassID = '{0}'",DropFQualiClassID.SelectedValue);
}
if (this.dropFQualiNclassID.SelectedValue != "0")
{
strSearch += String.Format(" AND FQualiNclassID = '{0}'",dropFQualiNclassID.SelectedValue);
}
if (dropFQualification.SelectedValue != "0")
{
strSearch += String.Format(" AND FQualification = '{0}'",dropFQualification.SelectedValue);
}
if (txtEnterName.Text.Trim() != "")
{
strSearch += String.Format(" AND FName LIKE '%{0}%'",txtEnterName.Text.Trim());
}
if (this.dropFYear.Visible)
{
strSearch += String.Format(" AND FYear = '{0}'",dropFYear.SelectedValue.Trim());
}
if (this.dropFQuarter.Visible)
{
strSearch += String.Format(" AND FQuarter = '{0}'",dropFQuarter.SelectedValue.Trim());
}
if (strSearch.Length > 5 && strSearch.Substring(0,5)==" AND ")
{
strSearch = strSearch.Remove(0,5);
}
if (strSearch.Length > 0)
{
Response.Redirect(String.Format("Enterprise/ApproveList.aspx?strSearch={0}",strSearch));
}
else
{
Response.Redirect("Enterprise/ApproveList.aspx");
}
2,ApproveList.aspx 接收搜索参数 执行搜索
if (Request.QueryString["strSearch"] != null)
{
DataTable dtTemp = dt.Copy();
dt.Rows.Clear();
dt = FilterBind(dtTemp,Request.QueryString["strSearch"].Trim());
}
string strSearch = string.Empty;
if (this.dropDistrict.SelectedIndex != 0)
{
strSearch += String.Format("{0} = '{1}'",( user.userID.Substring(0,6) == "230000") ? "City" : "District",dropDistrict.SelectedValue);
}
if (DropFQualiClassID.SelectedValue != "0")
{
strSearch += String.Format(" AND FQualiClassID = '{0}'",DropFQualiClassID.SelectedValue);
}
if (this.dropFQualiNclassID.SelectedValue != "0")
{
strSearch += String.Format(" AND FQualiNclassID = '{0}'",dropFQualiNclassID.SelectedValue);
}
if (dropFQualification.SelectedValue != "0")
{
strSearch += String.Format(" AND FQualification = '{0}'",dropFQualification.SelectedValue);
}
if (txtEnterName.Text.Trim() != "")
{
strSearch += String.Format(" AND FName LIKE '%{0}%'",txtEnterName.Text.Trim());
}
if (this.dropFYear.Visible)
{
strSearch += String.Format(" AND FYear = '{0}'",dropFYear.SelectedValue.Trim());
}
if (this.dropFQuarter.Visible)
{
strSearch += String.Format(" AND FQuarter = '{0}'",dropFQuarter.SelectedValue.Trim());
}
if (strSearch.Length > 5 && strSearch.Substring(0,5)==" AND ")
{
strSearch = strSearch.Remove(0,5);
}
if (strSearch.Length > 0)
{
Response.Redirect(String.Format("Enterprise/ApproveList.aspx?strSearch={0}",strSearch));
}
else
{
Response.Redirect("Enterprise/ApproveList.aspx");
}
2,ApproveList.aspx 接收搜索参数 执行搜索
if (Request.QueryString["strSearch"] != null)
{
DataTable dtTemp = dt.Copy();
dt.Rows.Clear();
dt = FilterBind(dtTemp,Request.QueryString["strSearch"].Trim());
}
相关文章推荐
- 谷歌搜索表单参数url参数详解
- 解析百度搜索结果link?url=参数分析 (全)
- 百度搜索结果的URL参数 搜索历史记录(rsv_sug)
- 百度搜索结果的URL参数 其他输入搜索词方式(rsv_n)
- 提取URL的搜索字符串中的参数
- 百度搜索URL参数
- 百度搜索URL参数
- 解析百度搜索结果link?url=参数分析 (全)
- 百度搜索URL各参数的含义
- 百度搜索结果的URL参数 搜索框位置(rsv_bp)
- 百度搜索URL参数详解
- 百度搜索URL参数含义
- 百度搜索结果的URL参数_输入耗时(inputT)
- 百度搜索结果页url参数详解
- 百度搜索URL参数含义
- 百度搜索URL参数
- 百度搜索结果的URL参数_反馈搜索结果用时(rsv_sug4)
- javascript提取URL的搜索字符串中的参数(自定义函数实现)
- 百度搜索url后的参数分析
- 百度搜索URL参数