开发者

MVCContrib Pager not emitting my query string

开发者 https://www.devze.com 2023-01-21 13:44 出处:网络
How do I get my original query string appended to the end of the pager output? All I am getting now is this:

How do I get my original query string appended to the end of the pager output? All I am getting now is this:

http://localhost:4988/Assets/Browse/1?page=2&Visible=false

I need all the various name/value pairs from my query string appended onto the next/previous links.

Also开发者_StackOverflow, what is “visible” used for in the above link? I didn’t add that.


IIRC the MVCContrib Pager helper automatically appends all query string parameters to the page links in addition to the currentPage parameter. If for some reason this doesn't happen you could use the Link method to create the link yourself:

<%= Html.Pager(Model)
        .Link(currentPage => Url.Action("someAction", new { 
            page = currentPage, 
            someParam = "someValue", 
            someOtherParam = "someOtherValue" 
        })) 
%>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号