Geeks With Blogs

News My Blog has been MOVED to
Michael Freidgeim's OLD Blog My Blog has been MOVED to

My code generate some dynamic HTML fragments and I want to know does the html valid.

Thanks to HtmlAgilityPack it is easy:


public static bool IsValidHtmlFragment(string html)


           HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();


               return (doc.ParseErrors.Count==0);


Posted on Thursday, July 26, 2007 5:52 PM ASP.NET , Testing/Debugging/Logging | Back to top

Comments on this post: Function to validate Html Fragment

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Michael Freidgeim | Powered by: