Closed VincentVanHulstPersonal closed 7 months ago
Hello, Vincent!
Quite non-standard functionality, similar to a CMS. I definitely haven't tested such things.
There are two ways to solve this problem:
HTML output of the following code is completely minified:
protected void Page_Init(object sender, EventArgs e)
{
var myControl = this.LoadControl("~/Controls/MyControl.ascx") as MyControl;
myPlaceholder.Controls.Add(myControl);
}
Thank you for this feedback. I will dive into this again. Only other thing that i can think of is that we have some nested .ascx loading. (index.aspx > main.ascx > overview.ascx).
Furthermore I have index.aspx > Inherits WebMarkupMin.AspNet4.WebForms.MinifiedAndCompressedHtmlPage The .ascx's just inherit > System.Web.UI.UserControl Is that correct?
Yes, this is correct.
Does the .ascx
file contain the pre
and textarea
tags, or ignoring comment tags?
Ok i think for now we can close this issue; i now see some html parsing errors in de logger. Probably that is the issue. Regarding your question: we do have textarea tags.
Yes problem solved; i found invalid markup in some CMS-content. Thank you for your help.
Content of tags listed above is never minified.
I recommend you to write your own logger or use the built-in logger (ThrowExceptionLogger
class). If you use ASP.NET Web Forms, then the logger for WebMarkupMin needs to be registered in the App_Start/WebMarkupMinConfig.cs
file as follows:
using WebMarkupMin.Core.Loggers;
…
DefaultLogger.Current = new ThrowExceptionLogger();
Hello, i was wondering if it would be possible to also minify the content of the html output rendered through .ascx controls? I have some .aspx pages with placeholders that load .ascx files on page init. The output of the .aspx page is minified/compressed but not the contents of the .ascx files.