More in this section

Forums / Developing with Sitefinity / Url WebEditor for Images and Documents module??

Url WebEditor for Images and Documents module??

3 posts, 0 answered
  1. Richard Murphy
    Richard Murphy avatar
    6 posts
    23 Mar 2006
    10 Dec 2008
    Link to this post
    Hello. My CMS users store their images and documents in the Sitefinity  Images and Documents module.

    They would like to be able choose an image URL from their libraries to in one of the user controls I have made for them.

    Astonishingly, there appears to be no equivalent to the Telerik.FileManager.UrlWebEditor type for the Images and Documents library.

    Please could you advise urgently? Thanks!
  2. Andrei
    Andrei avatar
    553 posts
    27 Nov 2008
    11 Dec 2008
    Link to this post
    Hi, I am currently trying to evaluate Sitefinity and see if it will do what i need it to do before buying. I am trying to add a UserControl with button on it, but I can not make the Property PostBackUrl to show a Select button for the users to browse to a page and select it that way.

    Can someone tell me what editor i need to use in Visual Studio so that when I load the UserControl it will have a Select button against the PostBackUrl property.

    Thank you
  3. Parvan
    Parvan avatar
    151 posts
    24 Sep 2012
    11 Dec 2008
    Link to this post
    Hello Richard Murphy,

    I suppose you used WebEditor attribute for design time support:

    public String ImageUrl  

    But it shows File structure of whole Sitefinity Web Site, not the Image&Documents Libraries (shown for example in Image Manager of RadEditor).

    We know that this is problem in our realization and we are sorry for the the inconvinience.

    However you can use this walkaround to open Dialog Window for Image & Documents:
    Example how to open Image&Documents dialog when the user clicks on a server button:

    using Telerik.Cms.Web.UI; 
    using System.ComponentModel; 
    using Telerik.Web.UI; 
    namespace MyLibrary 
        public class ThumbnailControl : CompositeControl 
            public TextBox ThumbnailTextBox 
                    return this.FindControl("Thumbnail"as TextBox; 
            [WebEditor("Telerik.FileManager.UrlWebEditor, Telerik.FileManager")] 
            public string Thumbnail 
                    if (this.ThumbnailTextBox != null
                        return ThumbnailTextBox.Text; 
                    return string.Empty; 
                    ThumbnailTextBox.Text = value; 
            protected override void CreateChildControls() 
                if (this.itemTemplate == null
                    this.itemTemplate = new DefaultItemTemplate(); 
                if (this.Page != null
                    this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"callback"this.GetScript(), true); 
            private string GetScript() 
                string result = "function CallBackFunction(radWindow, returnValue)" + 
                        "{" + 
                                "var oArea = document.getElementById('" + ThumbnailTextBox.ClientID + "');" + 
                                "if (returnValue) oArea.value = returnValue.src;" + 
                return result; 
            private ITemplate itemTemplate; 
            private class DefaultItemTemplate : ITemplate 
                public void InstantiateIn(Control container) 
                    TextBox txt = new TextBox(); 
                    txt.ID = "Thumbnail"
                    LinkButton btn = new LinkButton(); 
                    btn.ID = "picker"
                    btn.Text = "Select"
                    RadWindowManager manager = new RadWindowManager(); 
                    manager.ID = "RadWindowManager"
                    manager.VisibleOnPageLoad = false
                    RadWindow window = new RadWindow(); 
                    window.ID = "RadWindow1"
                    window.OpenerElementID = btn.ClientID; 
                    window.NavigateUrl = "~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx"
                    window.Width = Unit.Point(750); 
                    window.Height = Unit.Point(515); 
                    window.VisibleOnPageLoad = false
                    window.ClientCallBackFunction = "CallBackFunction"

    Let us know if this helps you for your user control.

    Best wishes,

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
3 posts, 0 answered