Click here to Skip to main content
11,717,570 members (79,946 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 Sergey Alexandrovich Kryukov 764
1 OriginalGriff 215
2 F-ES Sitecore 210
3 Maciej Los 140
4 Jochen Arndt 120
0 Sergey Alexandrovich Kryukov 1,494
1 OriginalGriff 535
2 Maciej Los 529
3 Richard MacCutchan 440
4 CHill60 415


Advertise | Privacy | Mobile
Web02 | 2.8.150901.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