本文介绍了Asp加入参数的URL字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在一个页面中显示过滤的项目清单,而现在我要限制由分页的结果显示。
I'm displaying a list of filtered items in a page, and now I have to limit the displaying by paginating the results.
所以,如果我有URL参数像这样的:
So if I have url parameters like these:
example/?category=pizza&period=today其中两个类别和期限,也没有被发现:
where both category and period can also not being showed:
example/?period=today example/我怎么能在保持以往任何参数,并增加了末尾添加一个下一页
how can I add a "Next page" in the end that keeps any previous parameter and adds
&pagenum=5如果没有参数:
?pagenum=5TNX提前!
推荐答案有关服务器端
string url = Request.Url.GetLeftPart(UriPartial.Path); url += (Request.QueryString.ToString() == "" ) ? "?pagenum=1" : "?" + Request.QueryString.ToString() + "&pagenum=1";您可以通过在页面数量取决于你是如何处理这一点。
You can pass in the page number depending on how you are handling this.
更多推荐
Asp.net加入参数的URL字符串
发布评论