Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3287156
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:27:41+00:00 2026-05-17T20:27:41+00:00

Given url /Page.aspx?a=b&title=apples+%26+pears , Request.Url property returns /Page.aspx?a=b&title=apples+&+pears Note that the url-encoded ampersand in

  • 0

Given url /Page.aspx?a=b&title=apples+%26+pears, Request.Url property returns /Page.aspx?a=b&title=apples+&+pears

Note that the url-encoded ampersand in the second key-value pair has been automatically decoded.
Other url-encoded reserved characters aren’t being automatically decoded.

Is this behaviour correct?

EDIT: The issue is that Request.Url property is automatically decoding the encoded ampersand when I don’t expect it to.

ANSWER: string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Host, Sitecore.Context.Request.RawUrl)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T20:27:41+00:00Added an answer on May 17, 2026 at 8:27 pm

    Url property of the Request gets decoded in an internal method called CollapsePercentUFromStringInternal.

    You can see this in the reflector. This I assumed is the default behaviour anyway.

    Update

    You can use RawUrl property to get hold of the un-decoded URL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following URL: domain.com/page.aspx?id=123 How can I sanitize that query string value when
Given a SharePoint page URL (http://server:8000/Pages/Default.aspx), how can I get value from the fields
Given: Url - http://www.contoso.com/search.php?q= {param} returns: -html- --body- {...} ---div id='foo'- ----div id='page1'/- ----div
I'm using this code, to make a request to a given URL: private static
I have an asp page (Default.aspx) that displays the diff between two text files.
Given a URL, I have to be able to know what the page's Type
I got a $(document).ready() handler in my aspx page that fires twice. I trapped
What is the best way to check if a given url points to a
I'ld like to analyze the certificate of a given url and get some details
I want to pop a browser with a given url from within a windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.