Abhilash J A

Abhilash J A

  • 534
  • 2.4k
  • 597.2k

Problem in adding image in word doc in Html MVC C#

Mar 23 2016 6:29 AM
Hello,


This is the c# code to generate word doc
public ActionResult SummaryExportToWord()
{
Response.Buffer = true;
//Response.AddHeader("content-disposition", "attachment; filename=ContactDetail.xls");
//Response.ContentType = "application/ms-excel";
Response.AddHeader("content-disposition", "attachment; filename=Exposure_Summary.doc");
Response.ContentType = "application/ms-word";
Response.Charset = "";
return View();
}

Image can't add to the word file. This is the image html:-
<td>
<img src="~/Pic/EMG%20Logo.png" width="200" height="50"/></td>
</tr>
The error is "The linked image cannot be displayed. The file may have been moved". How to show image in doc file from Html5?


Answers (1)