I have one XSLT file that takes elements from XML and gives HTML output i use
XslCompiledTransform()
to convert XSLT to html output in C# method. The output is then converted to HTML Email Message Body and sent to the client dynamically. I have some images embedded in the html everything works fine as long as my site at some domain. But when i test it from my Development Machine the images doesn't get sent to the client.
To overcome this i am using a class called
LinkedResource();
which helps to embed images in html. I works fine if you are writing custom html inside your html body. But in my case my html is being generated by XSLT.
Can anyone tell me how can i apply this (linedresource) to XSLT so that the html produced will contain the images.
SO far i have tried something like this:
var logoImageResource =new LinkedResource("C:\\MyProject\\Images\\logo.png")
{
ContentId = "logoId",
TransferEncoding = TransferEncoding.Base64
};
And my XLST file has used the ContentId like this:
<img src="cid:logoId" alt="logo"/>
Till now it doesn't work for me. Any help really appreciated.
在进行XSLT转换之前使用linkedresource语句可以正常工作。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.