Dump image with custom size

edited April 2014

I think that Util.Image() doesn't have arguments for custom image size. For that reason instead using Util.Image() I thought to try with Util.RawHtml() like in this line:
Util.RawHtml(String.Format("<img src='{0}' height='96' width='96' />", thumb.Element(d + "MediaUrl").Value))
However now I get Exception in dumped result:
Cannot parse custom HTML:
'<img src='http://ts4.mm.bing.net/th?id=HN.608030595988457907&pid=15.1' height='96' width='96' />'
- ''=' is an unexpected token.
The expected token is ';'. Line 1, position 70.
Why doesn't it validate the img src url that contains "=" char?
Any ideas how to resolve this?



  • I've run into this a couple of times where the URL specified in the SRC attribute (or an HREF attribute on an anchor tag) contains a query string. As the actual error appears to becoming from XElement.Parse, you actually need to swap the ampersands in your URLs with "&". Worked for me!
  • edited November 2017
    Thanx for that code! I will use it in my app project about sky of vegas
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!