unable to add user control

Posted by Community Admin on 03-Aug-2018 18:22

unable to add user control

All Replies

Posted by Community Admin on 02-Feb-2011 00:00

I created a custom user control and in doing so I followed the "tutorial" that I read in the SF 4 docs. I can see the new widget in the toolbox when I goto the page templates, but when I drag and drop the widget to the template, I'm getting the following error message:

'couldnot load type SitefinityWebApp.usercontrol.myUsercontrol.ascx'

the widget is just some basic HTML, how can I use this widget that i created?

Posted by Community Admin on 02-Feb-2011 00:00

Hello DotNetGuy,

Can you attach a screenshot of the Configuration settings you used to register the control and the control location in your solution?

Greetings,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 03-Feb-2011 00:00

Config settings??


I have the control in /SitefinityWebApp/usercontrols/usercontrolname.ascx

Posted by Community Admin on 03-Feb-2011 00:00

Hi DotNetGuy,

I mean Administration >> Settings >> Advanced >> Toolboxes >>... where you register the control and its location on the server.

Administration >> Settings is represented by configuration provider ( xml file storage) which stores the data inside App_Data/Sitefinity/Configuration

The error you see means that the path you used to register the control is not correct. You see the widget in the list, because you have "added" a new toolbox item - new record in the configuration, but the config element does not know whether the path the control is correct or not

Greetings,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 04-Feb-2011 00:00

how do I add the information to the app_data/sitefinity/configuration folder?

Is there any doc on this? So far I haven't found anything on it

Posted by Community Admin on 04-Feb-2011 00:00

Hi DotNetGuy,

I am sending you a short video that shows how to register a control.

All the best,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 04-Feb-2011 00:00

there was no sound, but from what I could see I did all of that and still no luck

Posted by Community Admin on 04-Feb-2011 00:00

it worked! ! ! ! !

though I did nothing different then the first 5 times, but this time it worked

Posted by Community Admin on 10-Feb-2011 00:00

Hi,

I am getting the same problem here, the settings are correct because when I put a 'not correct' location of the control I get the error "The file '/MYAPP/MdyControls/Lexique.ascx' does not exist."

But I am getting Could not load type 'SitefinityWebApp.MyControls.Lexique', when I set the correct virtual path for the user control.

My control is very basic, with just a simple static test to see if it works or not.

Posted by Community Admin on 10-Feb-2011 00:00

Hi martani,

I cannot replicate issues with adding custom or user controls. Please take a look at attached video in one of the previous posts. It shows the process of creating and registering a control in Sitefinity. Make sure that you build the application after the control is created.

Regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 10-Feb-2011 00:00

Martani,
    Did you rebuild your project? Once I did that with my usercontrol I was fine,  just adding it to the toolbox wasn't good enough, I had to rebuild my Sitefinity project and then it worked.

Posted by Community Admin on 11-Feb-2011 00:00

Thanks DotNetGuy,

I confirm that rebuilding the project makes Sitefinity to recognize the control.

Posted by Community Admin on 23-May-2011 00:00

How am I supposed to rebuild the project on a production server without visual studio...

Posted by Community Admin on 23-May-2011 00:00

Hi,

Make a dummy change in the web.config or restart the server.

Kind regards,
Ivan Dimitrov
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

Posted by Community Admin on 02-Mar-2017 00:00

Hi,

We're using SiteFinity 9.1 and I'm having trouble getting a custom user control to show up in the toolbox. I followed the tutorials and watched the video referenced here. It's a basic Hello World control. I registered through the Admin and also using Thunder. It adds the info to the toolboxes config file as the following:

        <add enabled="True" name="My Widgets" title="My Widgets" description="My Widgets">
          <tools>
            <add enabled="True" type="~/CustomControls/HelloWorld/HelloWorld.ascx" title="HelloWorld" description="HelloWorld" visibilityMode="None" name="HelloWorld" />
          </tools>
        </add>

I've even built the application and restarted SiteFinity and still my control doesn't appear. Neither does the new section I created. 

What could I be doing wrong?

This thread is closed