Switch CodeBehind to CodeFile in sublayouts

Vasiliy Fomichev

In Posted

If you are still on .NET Web Form, Sitecore reloads the whole application after a change in configuration files or the /bin folder, resulting in slow subsequent loads. Change the control definition of the .ascx file to use the .cs file instead of the compiled DLL by using CodeFile instead of CodeBehind to avoid such resets. If you are working on a quick .aspx PoC – simply use inline C#.