public Dictionary<int, string> getPaging(HttpRequest req) { //Load the querystring keys CBQueryStringGenerator qsg = new CBQueryStringGenerator(req); //Create a dictionary to store the pages Dictionary<int, string> lsPaging = new Dictionary<int, string>(); //Do a loop for the amount of pages you have for (int i = 1; i <= this.totalPages; i++) { //Add or overwrite the p querystring parameter qsg.add("p", i.ToString(), true); //Add the page number and url to the dictionary lsPaging.Add(i, qsg.getQueryString()); } //Return the dictionary return lsPaging; }