.NET USER CONTROLS
.NET user controls provide an endless number of possibilities for your Umbraco installation. With user controls you can harness the power of .NET code inside your templates and content pages. If you can create something in a custom .NET application inside a user control, it's also possible to render/function it in an Umbraco rendered page.
Remember to have a <form runat=“server”/> tag in your template that encapsulates the user control. If you don't, the user control will not work.
This section shows how to extend the user experience by adding dynamic form functionality, as well as how to create custom data types for user input in the backoffice.
For detailed information on how to tap into the Umbraco Event Model, go to Chapter 12.
Using the built-in wrapper makes deploying custom code a real breeze. The simplest and most straightforward way to work with Umbraco and custom code is to create a standalone Visual Studio project in—basically—6 steps.
- Add your user controls (.ascx files).
- Write the code as needed.
- Build your solution and/or project.
- Copy the .ascx file(s) to the <install root>/usercontrols folder and copy the project DLL and any other dependency libraries used to the <install root>/bin folder.
- Create a macro, just like you did in the “Introduction ...