Click here to Skip to main content
15,942,426 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my controller,
i have
img = "../../FoodImages/" + Convert.ToString(reader[4]);

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.
ZurdoDev 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

You may to user "server.mappath" method to map the server path.
Share this answer
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....

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

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900