User Controls stored in a separate assembly

Posted by Community Admin on 04-Aug-2018 04:39

User Controls stored in a separate assembly

All Replies

Posted by Community Admin on 27-Jul-2011 00:00

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?  

Posted by Community Admin on 27-Jul-2011 00:00

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

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 27-Jul-2011 00:00

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? 

Posted by Community Admin on 29-Jul-2011 00:00

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

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 26-May-2016 00:00

Hi Boyan,

I have the same situation here.Attached my webapp proj and backend snapshot. But I do not see the widget once I run the application with the widget added to the home page.

PFA.

Posted by Community Admin on 01-Jun-2016 00:00

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

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed