0
votes

I'm creating a macro in Umbraco. I'm using a .NET user control and I add the .dll to the bin folder. But still I have the same error: Error loading userControl '~/usercontrols/Slider.ascx'

Could someone help me? Thank YOU,

2
Can you provide the error message? Without the error message, it is difficult to understand what the problem might be.Astuanax

2 Answers

0
votes

You can check this video to double check the steps you performed. You need to make sure the following things.

  1. The Path of of your User Control should be in \Umbraco\UserControl (where your Ascx file) reside

2) You need to have DLL in bin directory

3) You need to have all the Bin that are reference in your project.

Hope this helps.

0
votes

This error cause happen when we try to bind item with databound in code. so to remove this error check your OnItemDataBound functions and their code behind.

  <asp:Repeater ID="rptFooterMainNav" runat="server" OnItemDataBound="rptFooterMainNav_OnItemDataBound">

Default.ascx.cs

 protected void rptFooterMainNav_OnItemDataBound(object sender, RepeaterItemEventArgs e) {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {
                Node itm = e.Item.DataItem as Node;
                if (itm != null) {
                    Literal ltText = (Literal)e.Item.FindControl("ltText");
                    HyperLink hlLink = e.Item.FindControl("hlLink") as HyperLink;
                    if (itm.GetProperty(FieldName.LINK) != null && !string.IsNullOrEmpty(itm.GetProperty(FieldName.LINK).Value)) {
                        hlLink.NavigateUrl = umbraco.library.NiceUrl(Convert.ToInt16(itm.GetProperty(FieldName.LINK).Value));
                    }
                    hlLink.Text = itm.GetProperty(FieldName.TEXT).Value;
                }
            }
        }