Click here to Skip to main content
11,634,561 members (72,190 online)
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 20:16pm
sahmed4567
Edited 18-Dec-12 20: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 OriginalGriff 8,758
1 Sergey Alexandrovich Kryukov 8,264
2 Mika Wendelius 6,755
3 F-ES Sitecore 2,344
4 Suvendu Shekhar Giri 2,095


Advertise | Privacy | Mobile
Web03 | 2.8.150728.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2015
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