O'Reilly logo

Umbraco User's Guide by Paul Sterling, Nik Wahlberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

.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.

image 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.

image 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.

  1. Add your user controls (.ascx files).
  2. Write the code as needed.
  3. Build your solution and/or project.
  4. 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.
  5. Create a macro, just like you did in the “Introduction ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required