Click here to Skip to main content
12,621,228 members (34,892 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET HTML
In my controller,
i have
img = "../../FoodImages/" + Convert.ToString(reader[4]);
liImage.Add(img);


And View Page i have
<img src='<%=Model.AppetizerImagesist[i] %>' width="245px" height="175px" />


Thos is working in deployment environment but not in hosted one.
Posted 13-Dec-12 3:02am
massab363
Comments
ryanb31 13-Dec-12 8:16am
   
Did you view the source in IE after the page rendered? That will tell you the URL it is trying to get to and then you should be able to figure out what is going on.

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You may to user "server.mappath" method to map the server path.
  Permalink  
Comments
massab 13-Dec-12 8:58am
   
img = "../../FoodImages/" + Convert.ToString(reader[4]);
How to use in this line?
massab 13-Dec-12 12:32pm
   
How to use server.mapath dynamically? like i commented above?
Zaf Khan 13-Dec-12 18:16pm
   
in your view page change your existing code to....

<pre>
<img src='<%=Server.mappath(Model.AppetizerImagesist[i]) %>' width="245px" height="175px" />
</pre>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 13 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100