User control file not found when draging on the page
Hi,
Trying to create a simple user control 'ImagesRotator', I have followed the Sitefinity RTM documentation 'Creating a widget as a user control'.
I have created the folder MyControls in the application root and added aspx and cs files.
After successfully creating the Widget in the Toolboxes settings with ControlType = "~/MyControls/ImagesRotator.aspx", I tried to drop the widget to a page and had the message : the file doesnot exists.
Depending on how I launch the application from Project Manager or Visual Studio, the file name in the message box is :
/<project-name>/MyControls/ImagesRotator.aspx
or /MyControls/ImagesRotator.aspx
Note that the widget appears on the page but is not editable nor deletable.
Any idea ?
Regards
Vincent
Hi Vincent,
Please make sure that your file exists in the MyControls folder under the root of your website. Also please check there are no typos in the control registration and that you have built the site.
Kind regards,
Radoslav Georgiev
the Telerik team
What does it mean when you say 'build the site'?
Hi Pi Dev,
Open the SitefinityWebApp project in Visual studio and use Build.
Greetings,
Radoslav Georgiev
the Telerik team
And if you don't have a copy of Visual Studio on the production server what do you do?
Hello Pi Dev,
Open the ASCX file in the Control directive instead of CodeBehind use CodeFile and set the application relative path to the CS file. This will make ASP.NET compile the code at runtime.
All the best,
Radoslav Georgiev
the Telerik team
That worked.
Is there going to be much of a performance hit for using this technique?
Hi Pi,
This should not affect the performance. You can take a look at the discussion here.
All the best,
Ivan Dimitrov
the Telerik team