// TODO: Move to other class public string GetPathAndQueryString() { string s = PageUrl; // Include id in path if (!string.IsNullOrWhiteSpace(Id)) { s += "/" + Id; } // Include action in path if (!string.IsNullOrWhiteSpace(Action)) { s += "/" + Action; } // Include actionParmater in path if (ActionParameter != null && ActionParameter.Any()) { s += "/" + string.Join("/", ActionParameter); } // add query parameters at end return(string.Format("{0}{1}", s, EncodeQueryParams(QueryParamsToMap(QueryParams)))); }