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

Forums / Developing with Sitefinity / How do you popup the "Insert and Image" dialogue box, on a backend page?

How do you popup the "Insert and Image" dialogue box, on a backend page?

2 posts, 0 answered
  1. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    01 Jul 2013
    Link to this post
     am building a RadGrid control, which when a user clicks on a row, opens up an edit form.

    This form features a person photo image, which I require the functionality to change as the user desires.

    So I am trying to figure out the code to include in the code behind of the .asmx web control, that pops up the "Insert an image" dialogue, that you current have with the image control in Sitefinity.

    I have been experimenting with:

    <sf:MediaContentSelectorView    id="selectorView"    runat="server"    ContentType="Telerik.Sitefinity.Libraries.Model.Image"    ParentType="Telerik.Sitefinity.Libraries.Model.Album"    LibraryBinderServiceUrl="~/Sitefinity/Services/Content/AlbumService.svc/"    MediaContentBinderServiceUrl="~/Sitefinity/Services/Content/ImageService.svc/"    MediaContentItemsListDescriptionTemplate="Telerik.Sitefinity.Resources.Templates.Designers.Libraries.Images.ImageItemDescriptionTemplate.htm"    DisplayResizingOptionsControl="false"    ShowOpenOriginalSizeCheckBox="false"></sf:MediaContentSelectorView>

    As I have read a lot of forum topics, about this control. However, it opens up the image selector for images already uploaded. This is one step too far as I need to use the Insert an image" dialogue, as there are times images need to be uploaded rather than selected from existing.

    How on earth do I do this?

    Can I include a "sf" tagged control in the page, or do I need to open a new page with some type of form selector?

    What is the best approach to do this in 5.4?

    Attached is the form I am trying to pop-up on my backend page.
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    04 Jul 2013
    Link to this post
    Hello,

    There is a control that allows upload of an image and/or selection from already uploaded images. This control combines MediaContentSelectorView and MediaContentUploaderView. Here is a blog post that gives a sample of this control.
    <sf:EditorContentManagerDialog runat="server" ID="asyncImageSelector" DialogMode="Document" Width="540" HostedInRadWindow="false"  BodyCssClass="" />
    The DialogMode property of the control can be changed to Document, Image, Media (Video) allow selection and upload of different media types.

    A button pops up the control using jQuery dialog.
    this._uploadDialog = jQuery(this._asyncImageSelector.get_element()).dialog({
                    autoOpen: false,
                    modal: true,
                    width: 540,
                    height: "auto",
                    closeOnEscape: true,
                    resizable: false,
                    draggable: false,
                    zIndex: 5000,
                    dialogClass: "sfSelectorDialog"
                });


    Regards,
    Stanislav Velikov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered