开发者

MVCContrib Pager not emitting my query string

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜