Custom Control not found

Posted by Community Admin on 04-Aug-2018 16:42

Custom Control not found

All Replies

Posted by Community Admin on 01-Dec-2011 00:00

- I created a UserControl .ascx in a folder UserControls
- Uploaded the a.ascx and a.ascx.cs files to the server
- went to sf admin and added the toolbox file
- build the app and uploaded the SitefinityWebApp.dll
- created a test page

I can see my contol on my specified toolbox section, but when I drag the contol on the page I get an error 'The file '/UserControls/a.ascx' does not exist..

Any idea what I am doing wrong? Yes I think I tripple checked if the file is on the server.

Markus

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

You did put a tilde before the path setting? ~/UserControls/a.acsx ? If so you wouldnt be able to provide some screenshots eh? :)

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

Dear Steve
Thanks in your interest.
Here are the screenshots.

Markus

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

The step I always forget when I create a user control in making the control layout template (.ascx) an embedded resource.  In VS; right click the .ascx>Properties>Build Action>Embedded Resource.

HTH--Steve

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

Hey Steve, Steve here :)

Actually in his case he has an actual usercontrol, not just a view, so it should be set to:
ascx: Content
aspx.cs: Compile
aspx.designer.cs: Compile

...which is default so it probably is?  (can you validate that markus?)

This is a line from a control in one of my toolboxes...perhaps it needs the layout field?

<add enabled="True" type="~/UserControls/CME/OnTheRoadCalendar/OnTheRoadCalendar.ascx" title="OnTheRoadCalendar" description="OnTheRoadCalendar" cssClass="ontheroadIcon" layoutTemplate="~/UserControls/CME/OnTheRoadCalendar/OnTheRoadCalendar.ascx" visibilityMode="None" name="OnTheRoadCalendar" />


(Man this scrollbar is annoying)

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

Dear Steve
Thanks again

a) yes its set to content, compile compile as you expected
b) here comes the funny part though.
If I untick the enable I will not see the contol in the widgets box. If I tick enable I will see it - So far so good.
Here comes the strange part (maybe) I downloaded the ToolboxesConfig.config file and there is nothing in there!
I see my other control but not the new one.

So here are the questions.
1) when adding a toolbox item like I did. Would/should the app_data/sitefinity/configuration/ToolboxesConfiguration.config be updated
2) If no - what's that file for
3) If yes - why is the new control not in it but is showing up in widets anyhow.

Just to let you know. I added the line manually. Build solution. Uploaded SitefinityWebApp.dll and web.config again. ->Did not make any difference.

To make sure I made another .ascx and build first, uploaded .dll and then the .ascx and added it in settings.
This time a simple Hello World. I thought it could be a missleading error.
Same

Fiddler shows an 500 /Sitefinity/Services/Pages/ZoneEditorService.svc/Control/ error

"CommandName":"new","ErrorMessage":"","PlaceholderId":"content_t_m","ControlType":"~/UserControls/test.ascx","LayoutTemlpate":"","Title":"Test","Description":"Test","ClassId":"","Ordinal":1,"DockId":"RadDockClone_1322838961040","Parameters":[],"Attributes":[],"AddSubmit":null,"FormSubmitType":null,"reloadKey":null,"LayoutControlDataID":null,"PreviousPlaceholderID":null,"PageId":"17086282-b9dd-47ac-a2e4-d3bdee7b7160","PageNodeId":"82e43c10-6f99-4bf9-b807-eee78cf55ba0","Url":"/diverse-seiten/test_zum_loeschen/Action/Edit/de","MediaType":0

One more thing the action delete does not remove the widget from the page.
Markus

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

Stupid question. Any of you having a 1885 project laying around and can try a quick hello world .ascx  test.

Markus

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

I have two live 1885 sites with UserControls :/

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

I am sure wondering what I could be doing wrong.

I guess I have to open a ticket. Thanks for all the help and time invested.

According to this page: www.sitefinity.com/.../sitefinity-essentials-controls-adding-controls-to-the-toolbox.html I would expect the ToolbopxesConfiguration.config to be updated automatically when adding a toolbox item.

So the question would be why is it not doing it.

Markus

This thread is closed