Using HTML Tidy with ASP.NET Tags

1.4k views Asked by At

I've discovered a very nice tool for cleaning up a mess of HTML in a project I have inherited:

Basically, I can paste in my HTML, click the Tidy button, and it cleans everything up.

However, my project is an ASP.NET web site, and HTML Tidy does not know what an asp tag is.

Therefore, by default, it simply removes it.

Ouch! Suddenly, nothing works because I have no controls on my form.

Looking at the Help and going into Advanced features, I set the Output format to Side by Side Diff, which will display the asp tags, is something, but now the two halves do not appear to be very related.

Is there a way, using the web interface, that I can get HTML Tidy to output the items it does not understand?

If not, is there another tidy tool for ASP.NET pages that will not cut out all of my asp tags?

The closest question I found related to this was .NET version of HTML Tidy?, but there could be better answers that did not pull up in my search.

2

There are 2 answers

0
AudioBubble On BEST ANSWER

I found the best editor is to just configure all of the very elaborate settings from within Visual Studio's HTML Text Editor Options.

VS2010 HTML Text Editor Options

1
wes On

Tidy assumes you want to output valid HTML, so it doesn't play nice with ASP.NET server side tags. If you're just looking for something to indent your html, try http://tools.arantius.com/tabifier.