Web Controls

Web Controls

Web Controls

  • A Sitecore specific extension of the standard ASP.NET Web control
  • Used to generate some part of a Web page or response to an HTTP request
  • Transforms content to presentation using .NET code
  • Contains a definition item in the Content Tree and a Web control class file with a .cs file extension   
  • Must be initially created in an IDE, such as Visual Studio, not Developer Center

Registering Web Controls

  • Register in Developer Center to create definition item once it is written if Sitecore Rocks is not available
  • Use class name, namespace, and assembly to register
  • Assign class name to tag attribute

Web Control Definition Items

  • Content tab shows item definition, including the class name, namespace, and assembly

Sitecore Web Controls Guidelines

  • Set the disable-web-editing attribute on dynamically bound controls that should not be editable
  • Set the DataSource attribute to facilitate multivariant testing and real time personalization