Dump image with custom size
Options
Hi,
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:
Any ideas how to resolve this?
TIA
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:Why doesn't it validate the img src url that contains "=" char?
'<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.
Any ideas how to resolve this?
TIA
Comments
-
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!
-
Thanx for that code! I will use it in my app project about sky of vegas