Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to replace the image path using CK editor in ASP.NET with C#? I want to develop a standard template with Image/Logo using CK editor in asp.net with c#. Currently I have developed a template and replaced the values from database or statically. I need to change the image path using CK editor and set the template with required images.

Code Sample
C#
TemplateBody = TemplateBody.Replace("[DATE]", DateTime.Now.ToString("MMM dd yyyy"));TemplateBody = TemplateBody.Replace("<img alt=\"\" src=\"D:\axis_bank_statement_image.jpg\" style=\"height:172px; width:294px;\" />", "<img alt=\"\" src=\"D:\axis_bank_statement_image1.jpg\" style=\"height:172px; width:294px;\" />");


What I have tried:

Code Sample
C#
TemplateBody = TemplateBody.Replace("[DATE]", DateTime.Now.ToString("MMM dd yyyy"));TemplateBody = TemplateBody.Replace("<img alt=\"\" src=\"D:\axis_bank_statement_image.jpg\" style=\"height:172px; width:294px;\" />", "<img alt=\"\" src=\"D:\axis_bank_statement_image1.jpg\" style=\"height:172px; width:294px;\" />");
Posted
Updated 21-Jun-16 22:46pm
v4
Comments
Kornfeld Eliyahu Peter 22-Jun-16 4:58am    
I do not understand your problem/request, but it is wrong to put local path (D:\...) in an HTML template, you must use URI that points to a web resource (//server/folder/image.ext)

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