If you ever have to deploy custom User Controls to Sitefinity that are written in Classic ASP.NET (not ASP.NET MVC), below are the following steps to accomplish this:
- After creating the project using Sitefinity Project Manager, open the project using Visual Studio 2010 or Visual Studio 2012
- By default the Visual Studio project will have a name of SitefinityWebApp
- After the project has been opened in Visual Studio, create a folder in the Visual Studio project to house the User Controls that you will be creating such as "UserControls"
- Add an ASP.NET User Control to the folder
- Begin developing the content that you want to add to the User Control
- Compile the SitefinityWebApp Visual Studio project using the Build option. NOTE: If you use the Rebuild option, you will end up deleting unreferenced assemblies in the project thus causing additional problems with the deployment
- After compiling the project, you will have to register the control in the Toolboxes section in Advanced Settings
- After the control has been registered in the Toolboxes section, you should be able to open a Sitefinity Content Page and add the User Control as a Widget to the Page
- After publishing the Sitefinity page, you should be able to view the resultant page
- If you are then deploying this content to a hosted server for a fresh installation, you will have to do the following:
- Deploy the entire contents of the local directory structure
- If necessary, change the database connection string to provide the appropriate database credentials on the target hosting server
- If you are deploying changes to a hosted server, the steps you will have to follow differ slightly:
- Deploy any changes that were made to the local directory structure (such as the creation of the User Controls directory). Any code behind files are not required, only the .ascx source code which contains the presentation code.
- Register the appropriate User Controls in the Toolboxes section of the Advanced Settings
- Deploy the SitefinityWebApp.dll to the bin directory on the target hosted server
- Add the widget to the appropriate Sitefinity Content Page and verify that the widget is working as expected
No comments:
Post a Comment