This is likely a duplicate of the below question but the only answer is a dead link:
Minify Html output of ASP.NET Application
When working with ASP.Net one of t
Google Pagespeed will love this:
I struggled for a while with this and the best way that I found was a combination of a few things:
You can use my Helper Class MinifyHtmlAttribute on GitHubGist. It uses the Zeta Producer Html Compressor to minimize the HTML and with System.Web.Optimization's Bundling, to minimize inline javascript and CSS (for your critical css 0.0)
Zeta Producer Html Compressor NuGet Package
A .NET port of Google’s HtmlCompressor library to minify HTML source code.
Now you can compress and minify your html with inline css and javascript being minified as well!! Awesome! ;)
Hope someone finds this useful.