<img src="http://www.vclogos.co.uk/logo.php?subid=d18f655c3fc147&imgid=11542">
The above tag shows image when i create notepad html page but when i put it on asp.net it does not show image on the browser.
<img src="http://www.vclogos.co.uk/logo.php?subid=d18f655c3fc147&imgid=11542">
The above tag shows image when i create notepad html page but when i put it on asp.net it does not show image on the browser.
It doesn't work because the server behind the URL in question checks the HTTP referer and returns an empty page if a referer is set which doesn't match the expected one.
The referer tells the "vclogos" server from which website the request for loading the image came from.
This is probably a security measure from the page because they don't want people to do what you just tried to do: hotlink their images.
The thing is, when you test it from a "notepad html page", no referer is sent. This is also for security reasons, but from your browser's side: Sending file:///C:/Users/JohnDoe/Desktop/MyPrivateFiles/page.html
as referer URL would disclose private information from your computer. That's why nothing is sent. Therefore, the image is loaded - the same as if you copy and paste the URL into the address bar of your browser (then also no referer is sent).
However, when you include it on your website on the Internet, your page URL is sent as referer. The "vclogos" website now appears to check this value and return nothing if a referer is sent which is not one of their own (I'd guess they accept only http://www.vclogos.co.uk/something
so it will only work if it's included in their own website, not yours).
Long story short, you just can't load this image inside your website directly from this URL.
The only way would be to use a web request on the server side in ASP.NET which fetches the actual image and then serves it to the client as a resource which, from the browser's point of view, comes from your server (who got it from "vclogos" first, but without sending a referer). The thing is that if your server fetches the image data, you have control over what headers you send. (Unlike your website which, once loaded in the browser, doesn't have this control - the browser will send your page URL as referer and there is nothing you can do about that.)
Just a detail:
http://www.vclogos.co.uk/logo.php?subid=d18f655c3fc147&imgid=11542
is a link to a blank page...
http://www.vclogos.co.uk/logo.php?subid=d18f655c3fc147&imgid=11542
is the link to an image.
You are sending an encoded URL. Always use the decoded URL (such as urlencode in php or HttpServerUtility.UrlEncode Method (String) in aspx)