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

Forums / Developing with Sitefinity / Custom widgets recommendations

Custom widgets recommendations

4 posts, 0 answered
  1. Olivier
    Olivier avatar
    57 posts
    Registered:
    09 Jul 2010
    07 Sep 2011
    Link to this post
    Hi,

    With custom Widgets, do you have any recommendations or best practices concerning on how we could manage them in our Visual Studio solution.

    How should we organize them,
    - to be easily reusable ?
    - not to bother too much about copying manually .ascx around ?

    What do other developers suggest ?

    EDIT: To be a bit more clear, we would like to move our common widgets to a dedicated solution, but we're not sure how to handle ascx files in this case. What are the best practices to create reusable ascx files? Or should we stop using ascx files?

    Thanks,

    Olivier
  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    07 Sep 2011
    Link to this post
    Simple widgets are designed mainly to exist in the Sitefinity project in which they are going to be used. If you want to reuse them in another site you'll have to copy all the controls and related files and resources (ascx, images, scripts, etc) into the new project and make sure all the paths are correct. This is the nature of working with asp.net User Controls in general.

    However, Sitefinity also supports developing custom server controls. These are controls that exist in a separate project, and are compiled into their own dll. All of the resources (ascx, images, scripts, etc) are embedded into the DLL so all you need to do to reuse them in another Sitefinity site is to either reference the compiled DLL or add that project to the Sitefinity solution.

    I'm working on a blog post that demonstrates how to create a custom compiled widget, but until then there are several examples of these types of widgets in the Sitefinity SDK. Take a look at the Non-profit starter kit, which includes three compiled widgets (Calendar, Maps, Social).

    I hope this is helpful!
  3. Mike
    Mike avatar
    2 posts
    Registered:
    18 Apr 2012
    24 May 2012
    Link to this post
    I was wondering if you were able to create a custom compiled widget into a Sitefinity project?
  4. Mike
    Mike avatar
    2 posts
    Registered:
    18 Apr 2012
    24 May 2012
    Link to this post
    I was wondering if you were able to create a custom compiled widget into a Sitefinity project?
4 posts, 0 answered