More in this section

Forums / General Discussions / Standard Web User Controls and Sitefinity

Standard Web User Controls and Sitefinity

3 posts, 0 answered
  1. Carlos Redondo
    Carlos Redondo avatar
    21 posts
    Registered:
    09 Jan 2009
    21 Nov 2011
    Link to this post
    Hi guys,
    We are on a POC phase working with Sitefinity and Web User Controls.  Management's goal is to have a single set of Web User Controls (Compiled Widgets) that can be used on both Sitefinity CMS and on a standard ASP.Net app (a non-sitefinity web app).  Mainly reason is minimize the UI code duplication and, by consequent, development effort. 

    However, I just concern about what Pure Sitefinity  functionality could I dropping following this approach, so far my web user controls inherit from ASP.Net BASE System.Web.UI.UserControl class but not from Telerik.Sitefinity.Web.UI.SimpleView class for instance, since our ASP.Net web app has no reference to Sitefinity Dlls.  For instance, I'm under impression that "Widgets Templates" doesn't work for System.Web.UI.UserControl controls... if that correct. what else?

    Actually, I'm not sure if this approach (a single version for both Sitefinity and non-sitefinity ASP.Net web app) is the right path.  I'm concern on end up with a nightmare because we would not able to get the best from both worlds and have to accept that we have a functional but limited web user controls version, you know... "Hey, let's do this great new feature in our web users controls this guys of sitefinity just released... ooh.. no we can't because it wouldn't work in a standard non-sitefinity web app, or viceversa..."

    I'm really open to hear your thoughts... 



  2. Carlos Redondo
    Carlos Redondo avatar
    21 posts
    Registered:
    09 Jan 2009
    22 Nov 2011
    Link to this post
    As strategy we will implement a MVP (Model-View-Presenter) Pattern and have a set of User Controls for Sitefinty as well as a set of Standard Non-Sitefinity User Controls implementing the View Contract.  Both Presenter and Model layer will be reused in both solutions.

    That way we will be able to take advance of all Sitefinity benefits and minimize the code duplication... 

  3. Svetoslav Petsov
    Svetoslav Petsov avatar
    456 posts
    Registered:
    24 Sep 2012
    24 Nov 2011
    Link to this post
    Hello Carlos Redondo,

     You can use standard asp user controls (.ascx) with Sitefinity and they would work just like in a standard ASP application. Here you can see how to register the controls inside Sitefinity:
    http://www.sitefinity.com/40/help/developers-guide/sitefinity-essentials-controls-adding-controls-to-the-toolbox.html
    Of course, in some cases you will have to adjust some details so that they do not interfere with Sitefinity's way of work. 
    Creating the same user controls for a Sitefinity and a non-Sitefinity ASP application is not the best practice, but usually you wouldn't encounter any problems reusing standard .ascx controls in Sitefinity.
    Considering the MVP pattern - I am not sure if this would work great with Sitefinity. Sitefinity works with a similar to MVVM pattern and has its own routing implemented. You may get the MVP model to work, but this way you wouldn't be utilizing any of Sitefinity's built in features. What's more, how do you plan on having same models for the two applications?

    Kind regards,
    Svetoslav Petsov
    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 posts, 0 answered