Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

HTML
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
Updated 18-Dec-12 20:22pm
v2

1 solution

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
 
Share this answer
 
v3

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900