User Controls stored in a separate assembly
I was looking at the documentation provided here for uploading User Controls:
http://www.sitefinity.com/40/help/developers-guide/sitefinity-essentials-controls-adding-controls-to-the-toolbox.html
The article seems to address creating a User Control within the existing Sitefinity Web Application project, but there does not seem to be sufficient information to determine how to utilize a User Control which has been developed in a separate Web Application project.
What is the process/procedure to fill out the necessary fields if my User Control has been developed in a separate Web Application project?
Hello Samir Vaidya,
You should include the control's assembly in the bin folder of your SitefinityWebApp, and then you can register it in Sitefinity by specifying in the Type textbox the assembly name . (dot) class name or simply copy the namespace.class name as it appears in you separate WebApp project (e.g. if you have MyWebApp.Controls namespace and your class is MyClass.cs you should register a type MyWebApp.Controls.MyClass) If you have any additional questions, please let us know.
Greetings,
Boyan Barnev
the Telerik team
If I have a User Control rather than a Custom Control stored in a separate Web Application assembly, how do I fill out the specific fields needed for the Toolbox?
For example, in Sitefinity v. 3.x, I simply uploaded the .ascx (not the .ascx.cs) file and placed the assembly in the bin folder. I then copied over one of the settings in the Web.config file to register the User Control in the toolbox.
However, I would like to avoid manually editing the Web.config file in Sitefinity v. 4.x and instead rely on the user interface to handle the registration of User Controls. Therefore, if I have an .ascx file and an assembly, what additional fields do I need to complete and how would I specify their values since I can no longer upload a single .ascx file without code-behind like I was able to do using Sitefinity v. 3.7x?
Hi Samir Vaidya,
There should be no problem having a single *.ascx file uploaded in iSItefinity, and having the logic compiled in an assembly. What you need to do is reference this assembly properly in your *.ascx file in the tag prefix registration, so you can use the controls from it in the markup, but in Sitefinity backend, you will simply register this as a regular user control (specify the application-relative path to the *.ascx file and fill in the name, title and description fields as per your requirements)- this should be enough to get your control working as a widget on any Sitefinity page. Please do not hesitate to let us know if this functionality is causing any problems. Thanks in advance.
Regards,
Boyan Barnev
the Telerik team
Hi,
There is few ways to register a widget described in that article:
http://docs.sitefinity.com/register-a-new-widget-in-sitefinity-toolbox#register-a-widget-through-code-using-the-configuration-manager
From other hand in order to register control from external assembly it should be custom widget. More information could be found here:
- http://docs.sitefinity.com/overview-types-of-widgets#user-widgets
- http://docs.sitefinity.com/overview-user-and-custom-widgets
Regards,
Svetoslav Manchev
Telerik