Can you post how you are outputting the image url?
Razor will normally automatically escape the ampersands. If you view source on the page, it should look something like this: "/media/1005/contact.jpg?center=0.43333333333333335,0.49746192893401014&mode=crop&quality=90&width=768&heightratio=0.76171875&slimmage=true&rnd=130432563170000000"
Getcropurl escapping ampersand
When validating my site I get errors on the way the querstring for getCropUrl is formatted.
…dia/9628/aspergesoep.jpg?anchor=center&mode=crop&quality=65&width=152&height=1…
& did not start a character reference. (& probably should have been escaped as &.)
Is there a way to change this
Thanks in advance
Hi Wesley,
Can you post how you are outputting the image url?
Razor will normally automatically escape the ampersands. If you view source on the page, it should look something like this:
"/media/1005/contact.jpg?center=0.43333333333333335,0.49746192893401014&mode=crop&quality=90&width=768&heightratio=0.76171875&slimmage=true&rnd=130432563170000000"
Jeavon
gives me:
update: reviewing my code, it's proberly the html.raw
Html.Raw was the problem. Thnx for helping...
Yes, that is exactly it. You could encode it yourself, e.g.
HttpUtility.HtmlEncode(img.GetPropertyValue("productnaam"))
Edit, that should have been
HttpUtility.UrlEncode(img.GetPropertyValue("productnaam"))
It was HttpUtility.HtmlEncode.
HttpUtility.UrlEncode in combination with Html.Raw gives me:
Thnx. Again :)
Great, it was
HttpUtility.HtmlEncode
, right?I would really try and get rid of that Html.Raw, it shouldn't be needed like that....?
Yeah, i should. It has a lot of old code in it from my early days :)
is working on a reply...