We were trying to build the pagination model around the API that will return the current page URL , previous page URL , next page URL.
In our Controller method, we have few well defined Query Parameter and user can some Query parameter on his own which will be handled in the controller using
HttpUtility.ParseQueryString(Request.RequestUri.Query)
While preparing the current page URL , previous page URL , next page URL we will be modifying the limit offset and rest all the query parameters which user has passed should be there.
Is there any way dynamically build the URL as we might not be knowing all the Query String that user has passed.
We are currently using UrlHelper like this
var prevLink = offset > 0 ? urlHelper.Link(routeName, new {offset=(offset-limit)>=0? offset - limit:0,limit=limit }) : ""
we are unable to pass the other dynamic Query string parameters which user might have passed. Is there any way around it.