Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Philip 59 posts 73 karma points
    Jun 18, 2012 @ 15:47
    Philip
    0

    Browse Properties bug for Custom User Control Macros

    I am using Umbraco 4.7.2, and are trying to create a Macro from a .Net User Control. This works fine, but as soon as I click on "Browse Properties" to extract the properties from the Macro, it fails with the following error:

    Error reading usercontrols/ArticleList.ascx

    The following list shows the Public Properties from the Control. By checking the Properties and click the "Save Properties" button at the bottom, umbraco will create the corresponding Macro Elements.

    System.ArgumentException: The relative virtual path 'usercontrols/ArticleList.ascx' is not allowed here. at System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) at System.Web.Hosting.HostingEnvironment.MapPath(VirtualPath virtualPath) at umbraco.IO.IOHelper.MapPath(String path, Boolean useHttpContext) at umbraco.IO.IOHelper.ValidateEditPath(String filePath, String validDir) at umbraco.developer.assemblyBrowser.Page_Load(Object sender, EventArgs e)

     

    The codebehind for the control looks like the following:

    public partial class ArticleList : System.Web.UI.UserControl
        {
            public string Testify { getset; }
    
            protected override void OnLoad(EventArgs e)
            {
                base.OnLoad(e);
            }
        }

     


     


     

  • Laurence Gillian 600 posts 1219 karma points
    Jun 21, 2012 @ 11:49
    Laurence Gillian
    0

    Also experiencing the same problem.Known to be working with a nightly of 4.7.1.

    Laux

    This is the c#

    https://gist.github.com/2964913

     

  • Laurence Gillian 600 posts 1219 karma points
    Jun 21, 2012 @ 11:53
    Laurence Gillian
    0

    This issue has been resolved with http://umbraco.codeplex.com/workitem/30807

    Add slash / ;) 

  • Gregg Duncan 48 posts 70 karma points
    May 15, 2013 @ 17:50
    Gregg Duncan
    0

    I'm having the same issue. Please explain how this issue was resolved. The codeplex link you have above is bad and "Add Slash /" doesn't tell me much, if that is what resolved your issue.

    EDIT:

    Never mind. Adding a Slash "/" to the beginning of the path to the usercontrols does fix the issue.

    Selecting the user controls from the drop down sets the path as: usercontrols/controlname.ascx

    Had to be changed to: /usercontrols/controlname.ascx

    I've never had to do that before. I have no idea why it would require it this time. I've got somewhere around 20 macros built with user controls this same way. This was the first that required adding the slash.

Please Sign in or register to post replies

Write your reply to:

Draft