Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: HTML
Hi in my below code i am displaying an image with in html tabl it's working fine only if i've provided absolute path of an image , if i have give an relative path for an image it's not working...In my local system it's working i need to update under server where it was throwing error on image path....Pls find any soln
 
 StringBuilder sbb = new StringBuilder();
        sbb.AppendLine("<html><body><center><table width='100%' cellspacing='0' border='1'");
        sbb.AppendLine("<tr>");
        sbb.AppendLine("<td>");
        sbb.AppendLine("<center>");
        sbb.AppendLine("<img src='G:/Sayeed/xlent Proj/Matrimony/Matrimony Updated Final/images/cmp_logo.gif'>");
        sbb.AppendLine("</center>");
        sbb.AppendLine("</td>");
        sbb.AppendLine("</tr>");
        sbb.AppendLine("<tr>");
        sbb.AppendLine("<td align='right'>");
        sbb.AppendLine("Title");
        sbb.AppendLine("</td>");
        sbb.AppendLine("</tr>");
        sbb.AppendLine("<tr>");
        sbb.AppendLine("<td align='right'>");
        sbb.AppendLine("Company Address 1");
        sbb.AppendLine("</td>");
        sbb.AppendLine("</tr>");
        sbb.AppendLine("<tr>");
        sbb.AppendLine("<td align='right'>");
        sbb.AppendLine("Phone No");
        sbb.AppendLine("</td>");
        sbb.AppendLine("</tr>");
        sbb.AppendLine("</table></center></body></html>");
Posted 18-Dec-12 21:16pm
sahmed4562
Edited 18-Dec-12 21:22pm
v2

1 solution

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

Solution 1

as per my knowledge, keep the image in hosting server for ex: www.xyz.com/images/cmp_logo.gif Then give this image url in the code. because in hosting servers some you don't have enough permission to access other drives. replace with following code http://www.xyz.com/images/cmp_logo.gif
  Permalink  
v3

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 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,476
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,917


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2014
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