Search code examples
asp.nethtmlwhitespacemarkup

Cleaning 'messy' markup rendered by ASP.NET


Ive noticed when looking at the source of a page generated in ASP.NET, the actual markup is very messy - sort of a half-assed tabbed affair with bundles of whitespace thrown in (see pic).

alt text

Can anyone suggest a technique to remove/strip this whitespace?


Solution

  • Here is a good article on how to override the page render method:

    https://madskristensen.net/blog/remove-whitespace-from-your-aspnet-page/