Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
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 2:02am
ryanb31 at 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 at 13-Dec-12 8:58am
img = "../../FoodImages/" + Convert.ToString(reader[4]); How to use in this line?
massab at 13-Dec-12 12:32pm
How to use server.mapath dynamically? like i commented above?
Zaf Khan at 13-Dec-12 18:16pm
in your view page change your existing code to.... &lt;pre&gt; &lt;img src='&lt;%=Server.mappath(Model.AppetizerImagesist[i]) %&gt;' width="245px" height="175px" /&gt; &lt;/pre&gt;

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 529
1 OriginalGriff 307
2 Damith Weerasinghe 295
3 ravikhoda 260
4 Tadit Dash 180
0 Sergey Alexandrovich Kryukov 10,974
1 OriginalGriff 6,667
2 Peter Leow 4,760
3 Abhinav S 3,813
4 Maciej Los 3,565

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