Click here to Skip to main content
13,292,205 members (57,087 online)
Rate this:
Please Sign up or sign in to vote.
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.
Posted 13-Dec-12 3:02am
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
Please Sign up or sign in to vote.

Solution 1

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171207.1 | Last Updated 13 Dec 2012
Copyright © CodeProject, 1999-2017
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