Click here to Skip to main content
12,406,322 members (65,937 online)
Rate this:
 
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
sahmed4467
Updated 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
Top Experts
Last 24hrsThis month


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