Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have implemented two filter attribute WebMarkupMin for HTML minification and BundleMinifyInlineJsCss to move script to the end of the page before closing of body tag.

In HTML minification page source does not contain closing of html, body, head tags so I have added one page called `WebMarkupMinConfig` through which I can add all these tags as per this documentation and declare all of them in `Global.asax.cs` file as per below:

protected void Application_Start()
            {
         GlobalFilters.Filters.Add(new MinifyHtmlAttribute());
         GlobalFilters.Filters.Add(new ReplaceTagsAttribute());
         WebMarkupMinConfig.Configure(WebMarkupMinConfiguration.Instance);
    }

If I use all of above three lines it will generate HTML code twice for the same page like

HTML
<html>
   <head></head>
   <body></body>
   </html>
   <html>
   <head></head>
   <body></body>
   </html>


How can I fix this? Thanks.
Posted
Updated 23-Sep-15 19:15pm
v2
Comments
[no name] 24-Sep-15 2:49am    
Where you are adding the HTML code? Can you please provide us the code snippet as well?
Member 11036864 24-Sep-15 2:55am    
I am talking about page source in browser. The same layout it renders twice on the same page.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900