unable to add user control
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?
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
Config settings??
I have the control in /SitefinityWebApp/usercontrols/usercontrolname.ascx
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
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
Hi DotNetGuy,
I am sending you a short video that shows how to register a control.
All the best,
Ivan Dimitrov
the Telerik team
there was no sound, but from what I could see I did all of that and still no luck
it worked! ! ! ! !
though I did nothing different then the first 5 times, but this time it worked
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.
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
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.
Thanks DotNetGuy,
I confirm that rebuilding the project makes Sitefinity to recognize the control.
How am I supposed to rebuild the project on a production server without visual studio...
Hi,
Make a dummy change in the web.config or restart the server.
Kind regards,
Ivan Dimitrov
the Telerik team
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?