I'm passing a string with a URL from the controller to the view (using a model). While the string is in the controller, it is not encoded, but in the view the URL is encoded.
URL before encoding:
http://app.xpinator.com/FacebookPayments/FacebookDesktopAdData?paymentCode=s5usd920k&userLocale=en-us&ver=v3.0.1
URL after encoding:
http://localhost/FacebookPayments/FacebookPaymentItemData?paymentcode=v250usd45000k&userlocale=en-us&ver=v3.0.1
Relevant line in the view:
<meta property="og:url" content="@Model.URL" />
I want to display a decoded URL in the view. I tried using HttpUtility.HtmlDecode
, HttpUtility.UrlDecode
and Html.Raw
- nothing worked.
Any ideas?
EDIT:
Thanks to Daniel's comment I realized that the encoding is happening only when the URL is in a meta property. when its a "displayable" HTML there is no encoding.
Anyway, still looking for a solution.