By following the example above whenever you have to update your .NET code you just have to change your .ascx file, there is no need to touch or even deploy the .ascx file to the CMS server. There is an approach of using the built-in .Net folder within RedDot CMS but since you might as well just upload your files manually I dare to say – Why bother? Ok, you should bother in a clustered server system where you publish to multiple publishing targets, but for a simple one CMS one web server setup you might as well just stick to manual deployments.
In RedDot we are able to insert User Control tag into any area of a page. If you have to influence settings or content areas you can use several ways to generate content and integrate those within .Net applications. You can use XML files published by RedDot CMS or user attributes with inline edited content to changed and/or edit properties. Those can be passed through to your User Controls. No need to use the CMS as IDE for your .NET solutions, keep all parts of your project separate and everything is just fine.
Are you interested in how to integrate CSS files within the CMS? Read this article here or on a high level understanding and “how to” for CSS and CMS in general this article here.
How do you integrate ASP.NET in your RedDot CMS projects?
Read more RedDot CMS best practice articles here.
We avoid putting “@ Register” tags into every template by registering tag prefixes globally in the web.config file. That way you can create a MySuchAndSuchUserControl content class and the content authors can plonk them wherever they like.
You can also create a “CS” variant for code-behind files which use FileRead render tags to pull their content in from a regular .net project. Combine with VSS and a build machine to ensure your CMS always has up to date code and you can use CMS elements in your C#!
User Controls are exactly the way we figured out to integrate ASP.NET into our RedDot projects as well!
Two more hints:
1. The page directive is unnecessary if you make C# the default instead of VB in the IIS ASP.NET configuration. Like this you avoid the limitation of only one page directive per ASPX file.
2. If your UC requires content/translation from within RedDot you could define public properties in your UC with getters and setters. You may then pass the content place holder to the UC like this:
<uc:Search ID=”Search” runat=”server” SubmitButtonCaption=”<%stf_submit_button_caption%>” />