Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (results != null)
- {
- // Use NVC to build a Query String using internal HttpValueCollection
- NameValueCollection queryString = System.Web.HttpUtility.ParseQueryString(string.Empty);
- if (!string.IsNullOrEmpty(SearchBySolicitor.Text)) {
- queryString["firm"] = Server.UrlEncode(SearchBySolicitor.Text);
- }
- if (!string.IsNullOrEmpty(AreaOfLaw.Text)) {
- queryString["area"] = Server.UrlEncode(AreaOfLaw.Text);
- }
- if (!string.IsNullOrEmpty(Location.Text)) {
- queryString["location"] = Server.UrlEncode(Location.Text);
- }
- queryString.MyExtension("postcode", Postcode.Text);
- string URL = Sitecore.Links.LinkManager.GetItemUrl(results) + "?" + queryString.ToString();
- // Send user off to results
- Response.Redirect(URL);
- }
- else
- {
- // Unable to find results error
- litTest.Text = "Error! Unable to find results page";
- }
- public static class MyExtension
- {
- public void MyExtension(SomeType this queryString, string stringName, string text)
- {
- if (!string.IsNullOrEmpty(text))
- {
- queryString[stringName] = Server.UrlEncode(queryString, );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement