AspNetPager分页控件UrlRewritePattern参数设置的重写代码
程序员文章站
2024-03-31 17:49:16
复制代码 代码如下:
<aspnet:aspnetpager id="asppages" runat="server" custominfohtml="第%currentpageindex%/%pagecount%页,每页%pagesize%条,共%recordcount%条"
firstpagetext="首页" lastpagetext="尾页" nextpagetext="下一页" alwaysshow="true" cssclass="pp"
currentpagebuttonclass="cpb" pageindexboxtype="dropdownlist" prevpagetext="上一页"
showcustominfosection="left" showpageindexbox="never" submitbuttontext=" go "
textafterpageindexbox="页" pagesize="10" textbeforepageindexbox="转到" height="25px"
numericbuttoncount="4" width="98%" centercurrentpagebutton="true" custominfotextalign="left"
horizontalalign="right" onpagechanged="asppages_pagechanged"
urlrewritepattern="/knowledge/tag/%tagid%/%category%/pv{0}" urlpaging="true" enableurlrewriting="true">
</aspnet:aspnetpager>
复制代码 代码如下:
<aspnet:aspnetpager id="asppages" runat="server" custominfohtml="第%currentpageindex%/%pagecount%页,每页%pagesize%条,共%recordcount%条"
firstpagetext="首页" lastpagetext="尾页" nextpagetext="下一页" alwaysshow="true" cssclass="pp"
currentpagebuttonclass="cpb" pageindexboxtype="dropdownlist" prevpagetext="上一页"
showcustominfosection="left" showpageindexbox="never" submitbuttontext=" go "
textafterpageindexbox="页" pagesize="10" textbeforepageindexbox="转到" height="25px"
numericbuttoncount="4" width="98%" centercurrentpagebutton="true" custominfotextalign="left"
horizontalalign="right" onpagechanged="asppages_pagechanged"
urlrewritepattern="/knowledge/tag/%tagid%/%category%/pv{0}" urlpaging="true" enableurlrewriting="true">
</aspnet:aspnetpager>
protected void asppages_pagechanged(object sender, eventargs e)
{
string tagid = getrequest.getstring("tagid");
asppages.urlrewritepattern = string.isnullorempty(tagid) ? "/knowledge/tag/%tagid%/%category%/pv1" : "/knowledge/tag/%tagid%/%category%/pv{0}";
bindrptchateau(tagid);
}
<rewrite url="^/knowledge/tag/(\d+)/(\d+)/pv(\d+)$" to="~/search/searchknowledgetag.aspx?keywords=$1&tagid=$1&category=$2&page=$3" processing="stop"></rewrite>
上一篇: java调用ffmpeg实现转换视频
下一篇: Java中线程休眠编程实例