I have an Image control on my .aspx page and I want to set the ImageUrl to something like this:
<asp:Image ID="imgLogo" ImageUrl="C:\ExternalImages\logo.jpg" runat="server" />
But this doesn’t work. I read about the ImageUrl property on MSDN and it says that the url could have either be an absolute or relative path. But how can i set the complete path like shown above?
By absolute url, they mean the entire IIS path to the URL (Not your disk directory path). (i.e. http://yourVirtualDirectory/ExternalImages/logo.jpg).
Create a virtual directory on your IIS hosting machine that points to C:\ExternalImages. Use that virtual directory path in your control.