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

Forums / Developing with Sitefinity / Uploading user controls as a dll

Uploading user controls as a dll

5 posts, 0 answered
  1. aster
    aster avatar
    12 posts
    Registered:
    08 Dec 2009
    06 Jan 2010
    Link to this post
    Hi,

    Has anyone has tried uploading a project dll; a project that has the user controls one would like to use in Sitefinity. I have tried this and Sitefinity picks up all the user controls and aspx files that are listed, but any time I try to use them I get an error saying "Object reference not set to an instance of an object".

    Could you please post on how you have packaged a bunch of user controls into one dll and used them with in Sitefinity.

    Thanks!
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    07 Jan 2010
    Link to this post
    Hello Aster,

    Sitefinity does not support uploading of user controls in assembly. You can place the assembly in the bin directory and reference the controls, or put them declaratively through the web.config in the toolbox though. 

    We can reference the custom controls automatically, but not the user controls.

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. aster
    aster avatar
    12 posts
    Registered:
    08 Dec 2009
    07 Jan 2010
    Link to this post
    Hi Georgi,

    Thanks for your reply. When you say "You can place the assembly in the bin directory and reference the controls, or put them declaratively through the web.config in the toolbox though", how do I go about adding them to my pages.

    Say I have a user control hello.ascx in the project.dll, I placed in the bin. How can I drag and drop this hello.ascx file from the admin console onto any newly created sitefinity pages.

    Thanks!
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    07 Jan 2010
    Link to this post
    Hi aster,

    This answers your question

    " put them declaratively through the web.config in the toolbox though"

    sample

    <add name="control" section="mysection" type="Samples.Test.MyContorol, Samples.Test" description="some description."/>

    <%@ Register Assembly="SampleTest" Namespace="SampleTest.Controls" TagPrefix="cc" %>
     
    <cc:MyControl runat="server" ID="MyControl1">


    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. aster
    aster avatar
    12 posts
    Registered:
    08 Dec 2009
    07 Jan 2010
    Link to this post
    I am sorry for asking a very silly question, however, here goes, where would I add
    <%@ Register Assembly="SampleTest" Namespace="SampleTest.Controls" TagPrefix="cc" %> 
      
    <cc:MyControl runat="server" ID="MyControl1"
     

    the above snippet of code. Do I have create new aspx pages to the Sitefinity project from Visual Studio and add them there, or is there a way I can do this from the administration console?

    Thanks
Register for webinar
5 posts, 0 answered