More in this section

Forums / Developing with Sitefinity / user control vs external page, which is the better option?

user control vs external page, which is the better option?

2 posts, 0 answered
  1. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    18 Jul 2012
    23 Jun 2008
    Link to this post
    Sitefinity is able to handle pretty much all of the static content pages our site requires, however there are a few sections which require script on a page for say a survey, or contact form. Since the sections are so different, the code is not really reusable, so I'm wondering then what the performance and organizational considerations are for implementing these pages as external pages instead of embedding a user control inside a sitefinity page.

    It seems like developing a user control just to embed it into a sitefinity page creates a lot of overhead (for example, having to register the control in web.config when it will only be used on one page) when we can just develop the page directly and then link to it as an external page. are there any disadvantages to either approach that are not immediately obvious? the practical conclusion at which I've arrived is "it doesn't make a difference do whatever is easier" but I'd like to know from a developing and performance standpoint what the difference is.
  2. Pepi
    Pepi avatar
    981 posts
    31 Jan 2017
    24 Jun 2008
    Link to this post
    Hello SelArom,

    The better approach is to wrap the required functionality in a user control than implement it directly in a page (.aspx). User controls are easy to add to any web page once you created them. So there is no need to code again the same functionality if it is used in another page of the web application. It is also possible to convert the whole web pages into a user control with some minor modifications and use it anywhere.

    If you use user controls the development is modularized which means that you have different functionalities available after registering the controls in the web.config. This speeds up the development process.

    All the best,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered