Asp.net加入参数的URL字符串

编程入门 行业动态 更新时间:2024-10-21 05:34:00
本文介绍了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=5

TNX提前!

推荐答案

有关服务器端

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字符串

本文发布于:2023-11-14 19:37:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1588339.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   参数   Asp   net   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!