I got a question yesterday from a designer who is unfamiliar with ASP.NET asking what the difference is between ASCX mode and HTML mode when developing skins and containers for DotNetNuke.
I thought it might be useful to the community if I answered this for everyone.
ASCX files are user controls (an ASP.NET thing). With DNN you can create skins using HTML, and when the file is uploaded on the server tokens are parsed and it is converted to an ASCX file. Or you can just create it as an ASCX file to start with.
The advantage of doing it as an ASCX file is that you have a lot more control and end up with a skin that is not as messed up as the ones that are translated. For example, many skins that are created with HTML end up having a reference to the CSS file in both the skin (or container) and the main page when DotNetNuke sucks the file in. You also tend to end up with a lot more HTML than you really need, even if the translation works right. The final issue is that it is difficult to make a skin that has collapsible sections that are hidden if content is not available for that pane.
The advantage of doing it as an HTML file is that it is a BIT more familiar to a designer and he can use the HTML editor he is familiar with to create the skin or container. This is the main reason the HTML skinning method was designed. At the time, allowing designers to use their tools to skin was a reasonable decision since admittedly the design tools that were available in Visual Studio were a lot weaker than what most designers were used to. Allowing HTML mode also helped increase the adoption rate of DotNetNuke. I doubt that there would be nearly as many skins available for DotNetNuke as there are and, therefore, as many people willing to use it as the first choice solution for so many web sites, if it were not for the fact that designers need to learn very little about DotNetNuke skinning to make it look good.
However, that doesn’t mean using HTML has ever been the best way to create a skin. In my opinion, you are better off doing it as an ASCX file because of the crap that gets placed in the file when you translate. As a designer, you have to learn something anyhow… either how to put ASP.NET user controls in the file (with ASCX) or how to put tokens in the file (HTML). Why not spend a little extra time learning how to use ASCX files and get the control most designers really want anyhow?
It is true that you won’t be able to use Dream Weaver to do your editing. But now that Visual Studio Web Developer Express is out (free tool) you could do your initial design work in Dream Weaver and copy/paste/modify into an ASCX file in Web Developer Express. Or you could do all of your work in Web Developer Express. You might just like it.
Other places talking about DotNetNuke Skinning:
My Thoughts on the new [PACKT] book on DotNetNuke Skinning … – However, as soon as a web site owner takes the time to learn the ropes of constructing a custom DotNetNuke skin, they likely jump the gun and create a skin that ends up looking no better than a $20 skin off Snowcovered, …
Book Review: DotNetNuke Skinning Tutorial – In this review, Shaun discusses Darren Neese’s book, DotNetNuke Skinning Tutorial. Shaun looks at the book from the eyes of a developer whose area of expertise is not design. He offers his insight into the book here.
Other post in DotNetNuke - Skinning
- DotNetNuke Skinning - Getting Set Up - June 10th, 2008
- DotNetNuke Skins - Handling CSS Files - June 12th, 2008
- DotNetNuke Skins - Hello, World - June 17th, 2008
- DotNetNuke Skins - Skin Objects - June 19th, 2008
- DotNetNuke Skinning - Dealing with Images - July 3rd, 2008
- DotNetNuke - Avoiding Container Collision - June 11th, 2012
- Infinite DotNetNuke Skin Sets For One Low Price - August 14th, 2012
- DotNetNuke Skins - ASCX vs HTML mode - November 6th, 2012
- DotNetNuke Skinning - Collapsible Containers - January 8th, 2013
- DotNetNuke Skinning - Standard CSS Classes - February 5th, 2013
- DotNetNuke - Skinning - March 12th, 2013
- DotNetNuke Skinning - Containers - December 18th, 2013
- DotNetNuke Skinning - SolPartMenu - January 29th, 2014