I want it to parse HTML and than display the proper styling on a save.
Should I use HTML agility pack?
What is some C# code for the button save to initiate the parse? How do I pass the user defined HTML to the save method within the controller?
Would one example be (In TemplateController):
public void Save()
{
HtmlDocument document = new HtmlDocument();
string htmlString = "<html>blabla</html>";
document.LoadHtml(htmlString);
HtmlNodeCollection collection = document.DocumentNode.SelectNodes("//a");
foreach (HtmlNode link in collection)
{
string target = link.Attributes["href"].Value;
}
}
This post has been edited by regex: 11 February 2013 - 09:57 AM

New Topic/Question
Reply



MultiQuote


|