Loading image into WebPage...
-
<asp:Image ID="Image1" runat="server" Height="416px" ImageUrl="E:/College Photos/Farewell Party/DSC08182.JPG" Width="846px" /> When iam loading image from other than current directory the image is not loading ... / If i copy the same photos into current directory it is loading ... What is going beyond it , why the problem exists.....
-
<asp:Image ID="Image1" runat="server" Height="416px" ImageUrl="E:/College Photos/Farewell Party/DSC08182.JPG" Width="846px" /> When iam loading image from other than current directory the image is not loading ... / If i copy the same photos into current directory it is loading ... What is going beyond it , why the problem exists.....
Pardhu2 wrote:
ImageUrl="E:/College Photos/Farewell Party/DSC08182.JPG"
What are you doing.... Always use relative path to the server. Means if the pictures is in folder
a
under your root directory xx then you should write :ImageUrl = "~xx/a/DSC08182.JPG"
Always remember, ImageUrl will be transmitted to the html sent to the client as response. Now from browser of the client it cant point toE:/College Photos/Farewell Party/DSC08182.JPG
as it would mean its own computer. The browser should request url usinghttp://www.yourserver.com/xx/a/DSC08182.JPG
Hope you got it. :-D :thumbsup:Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
Pardhu2 wrote:
ImageUrl="E:/College Photos/Farewell Party/DSC08182.JPG"
What are you doing.... Always use relative path to the server. Means if the pictures is in folder
a
under your root directory xx then you should write :ImageUrl = "~xx/a/DSC08182.JPG"
Always remember, ImageUrl will be transmitted to the html sent to the client as response. Now from browser of the client it cant point toE:/College Photos/Farewell Party/DSC08182.JPG
as it would mean its own computer. The browser should request url usinghttp://www.yourserver.com/xx/a/DSC08182.JPG
Hope you got it. :-D :thumbsup:Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascriptthnku i got it .... but how to point the url to local host (e://.....) which u mentioned in last case...... http://www.yourserver.com/xx/a/DSC08182.JPG[^]
-
thnku i got it .... but how to point the url to local host (e://.....) which u mentioned in last case...... http://www.yourserver.com/xx/a/DSC08182.JPG[^]
Just use relative path as I mentioned.
~/xx/a/DSC08182.JPG
will automatically point tohttp://localhost/xx/aa/DSC08182.JPG
if you are running from localhost. ;) Cheers.Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
<asp:Image ID="Image1" runat="server" Height="416px" ImageUrl="E:/College Photos/Farewell Party/DSC08182.JPG" Width="846px" /> When iam loading image from other than current directory the image is not loading ... / If i copy the same photos into current directory it is loading ... What is going beyond it , why the problem exists.....
It's also worth pointing out that if you decide to use plain old html instead of an asp:Image then you should drop the tilde(~) Mark Graham (MCP) blogging about Design Patterns, C#, Asp.Net, CSS, Javascript and Ajax at: DESIGN CODE TEST[^]