Hi, I want to change htm's name and his links too, for this i'm trying to use radeditor, my question is, it's posible to modify links in htm with radeditor in c#?, i'm trying with this code:
RadEditor1.Content = ReadFile(Server.MapPath("~/"+Root()+"/example.htm");
string mod = Root().Replace(" ", "%20");
RadEditor1.Content.Replace("href='"+mod,"href='"+NewRoot);
using (StreamWriter externalFile = new StreamWriter(Path.Combine(Server.MapPath("~/"+NewRoot), "Newexample.htm"), false, Encoding.UTF8))//Open file for writing and write content
{
externalFile.Write(RadEditor1.Content);
}
protected string ReadFile(string path)
{
if (!System.IO.File.Exists(path))
{ return string.Empty; }//fin if file exists
using (System.IO.StreamReader sr = new System.IO.StreamReader(path, Encoding.GetEncoding("macintosh")))
{ return sr.ReadToEnd(); }
}
but I think that Replace() no work with html, please help me
RadEditor1.Content = ReadFile(Server.MapPath("~/"+Root()+"/example.htm");
string mod = Root().Replace(" ", "%20");
RadEditor1.Content.Replace("href='"+mod,"href='"+NewRoot);
using (StreamWriter externalFile = new StreamWriter(Path.Combine(Server.MapPath("~/"+NewRoot), "Newexample.htm"), false, Encoding.UTF8))//Open file for writing and write content
{
externalFile.Write(RadEditor1.Content);
}
protected string ReadFile(string path)
{
if (!System.IO.File.Exists(path))
{ return string.Empty; }//fin if file exists
using (System.IO.StreamReader sr = new System.IO.StreamReader(path, Encoding.GetEncoding("macintosh")))
{ return sr.ReadToEnd(); }
}
but I think that Replace() no work with html, please help me