Total Pageviews

2 Aug 2013

ManagedLink Attribute for Web Part Properties that Converts Absolute URLs to Relative Ones

[ManagedLink] above the web part property automatically converts full Urls to relative ones. very useful for fool proofing against incorrectly typed URL's.
For example, http://portal/Lists/CustomList/Forms/Display.asxp becomes l/Lists/CustomList/Forms/Display.asxp


C# example:
        [WebBrowsable(true),
        Category("Configuration"),
        Personalizable(PersonalizationScope.Shared),
        WebDisplayName("Friendly Display Name"),
        WebDescription("Values: Whatever value you need")]
        [ManagedLink]

        public Uri URI { get; set; }

No comments:

Post a Comment