+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / User Controls stored in a separate assembly

User Controls stored in a separate assembly

6 posts, 0 answered
  1. Samir Vaidya
    Samir Vaidya avatar
    261 posts
    Registered:
    05 Feb 2005
    27 Jul 2011
    Link to this post
    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?  
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    19 Sep 2016
    27 Jul 2011
    Link to this post
    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
  3. Samir Vaidya
    Samir Vaidya avatar
    261 posts
    Registered:
    05 Feb 2005
    27 Jul 2011
    Link to this post
    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? 
  4. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    19 Sep 2016
    29 Jul 2011
    Link to this post
    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
  5. Faiz
    Faiz avatar
    1 posts
    Registered:
    24 Feb 2016
    26 May in reply to Boyan Barnev
    Link to this post

    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.

  6. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    22 Sep 2016
    01 Jun
    Link to this post
    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
     
6 posts, 0 answered