我按关键字搜索,当我翻页后搜不信息,只能搜到第一页上面的内容。请问是怎么回事呢?
当我翻页搜索后,打印关键字,却得不到我输入的关键字,得到的都是“全部”!
大家帮帮忙啊
<FORM id="searchForm" name="searchForm" action="<%=urls%>" method="post">
<TD width="40%" class="forumRowHighlight"><span class="STYLE3">关键字</span>:
<input name="keywords" type="text"/>
<input id="submit" type="submit" value="立刻查找" name="submit" />
keyword = (Request["keywords"] != null && Request["keywords"].Length != 0) ? Request["keywords"] : "全部";
if (keyword != "全部")
{
wheres += " and username like ''%" + keyword + "%''or tel like ''%" + keyword + "%''or email like ''%" + keyword + "%''";
}
当我翻页搜索后,打印关键字,却得不到我输入的关键字,得到的都是“全部”!
大家帮帮忙啊
<FORM id="searchForm" name="searchForm" action="<%=urls%>" method="post">
<TD width="40%" class="forumRowHighlight"><span class="STYLE3">关键字</span>:
<input name="keywords" type="text"/>
<input id="submit" type="submit" value="立刻查找" name="submit" />
keyword = (Request["keywords"] != null && Request["keywords"].Length != 0) ? Request["keywords"] : "全部";
if (keyword != "全部")
{
wheres += " and username like ''%" + keyword + "%''or tel like ''%" + keyword + "%''or email like ''%" + keyword + "%''";
}
有啊 Page PageClass = new Page(tables, "id,username,tel,email,respective_projects,(select top 1 tname from customer_users where id=" + tables + ".userid) as rname,adddate,(select top 1 id from customer_alone_record where comid=" + tables + ".id) as reid", wheres, "id", "1", "id", "" + urls + "?keywords=" + keyword + "&page=", 30, page, "");
是空的, urls = "";改成这样可以了: urls = "default.aspx";