+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Page Url picker

Page Url picker

3 posts, 1 answered
  1. Gema
    Gema avatar
    46 posts
    Registered:
    02 Oct 2009
    12 Apr 2011
    Link to this post
    Hi,
    I´m developing a custom module, and one of de properties I have to save,  is a page url.
    I know, than in design time I can set

    [WebEditor(

    "Telerik.Cms.Web.UI.UrlEditorWrapper, Telerik.Cms")]

     

     to a property, but I need it not in design time.
    I need something similar to the button "Select" in property "Channel page" when you create a new feed.

    Could you explain me, what I have to do to set this functionality in my "Select" button?

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    12 Apr 2011
    Link to this post
    Hello mgrp,

    You have to use PropertyEditorDialog

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Answered
  3. Gema
    Gema avatar
    46 posts
    Registered:
    02 Oct 2009
    13 Apr 2011
    Link to this post
    I´ve used the code from the post
    http://www.sitefinity.com/devnet/forums/sitefinity-3-x/developing-with-sitefinity/opening-imageselector-from-custom-webuitypeeditor.aspx

    private string image;
        private PropertyEditorDialog Dialog;
     
        protected void Page_Load(object sender, EventArgs e)
        {
     
            this.Dialog = new PropertyEditorDialog();
            this.Dialog.TypeContainer = this;
            this.Dialog.PropertyChanged += new PropertyValueChangedEventHandler(editorDialog_PropertyChanged);
            this.Dialog.Width = Unit.Pixel(300);
            this.Dialog.Height = Unit.Pixel(300);
            this.Controls.Add(this.Dialog);
     
            this.urlPicker.CommandName = "Telerik.Cms.Web.UI.UrlEditorWrapper, Telerik.Cms";
            this.urlPicker.CommandArgument = "Choose a page";
            this.urlPicker.Command += new CommandEventHandler(urlPicker_Command);
     
        }
     
        void urlPicker_Command(object sender, CommandEventArgs e) {
            string name = (string)e.CommandArgument;
            this.Dialog.Show(name, e.CommandName);
        }
     
        void editorDialog_PropertyChanged(object source, PropertyValueChangedEventArgs e)
        {
            textbox.Text = e.PropertyValue.ToString();
        }

    It´s perfect for me.
    Thanks a lot.
Register for webinar
3 posts, 1 answered