More in this section
Forums / Developing with Sitefinity / Intra Module Image Selector

Intra Module Image Selector

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. martin
    martin avatar
    36 posts
    30 Nov 2008
    01 Dec 2011
    Link to this post

    I am trying to create an Intra Module, I need to be able to select and image.

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddEditView.ascx.cs" Inherits="SitefinityWebApp.Modules.Testimonials.Admin.AddEditView" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.Fields" TagPrefix="sf" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Modules.Libraries.Web.UI.Designers" TagPrefix="sfy" %>
    <h1 class="sfBreadCrumb">
    <div class="sfMain sfClearfix">
        <div class="sfContent">
            <div class="rgTopOffset sfWorkArea">
                <fieldset class="sfNewContentForm">
                    <div class="sfFormIn">
                                <asp:Label ID="lblTitleText" runat="server" AssociatedControlID="TitleText" Text="Title Text" CssClass="sfTxtLbl" />
                                <asp:TextBox ID="TitleText" runat="server" CssClass="sfTxt" />
                                <asp:Label ID="lblPosition" runat="server" AssociatedControlID="Position" Text="Position" CssClass="sfTxtLbl" />
                                <asp:TextBox ID="Position" runat="server" CssClass="sfTxt" />
                                <asp:Label ID="lblImage" runat="server" Text="Image" />
                                <sf:ImageField ID="productImageField" runat="server" DataFieldType="Telerik.Sitefinity.Model.ContentLinks.ContentLink" DisplayMode="Write" ShowDeleteImageButton="false" CssClass="sfprofileField sfprofileAvatar"/>
                            <asp:Button ID="btnSave" runat="server" Text="Save Testimonial" OnClick="btnSave_Click" />
                            or <a href="<%= ResolveUrl(Telerik.Sitefinity.Web.SiteMapBase.GetActualCurrentNode().ParentNode.Url)%>">Cancel and go back to Testimonials</a></p>

    My issue is how do I get the value of the selected image out of either the MediaContentSelectorView or the sf:ImageField.

    Or am I doing this complete WRONG and if so how do I go about doing it.

  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    18 Sep 2017
    06 Dec 2011
    Link to this post
    Hello Martin,

    I have attached a project with the implementation of the image selctor. The credentials for the project are admin/password . The approach is to use another field

    <sf:EditorContentManagerDialog runat="server" ID="asyncImageSelector" DialogMode="Image" Width="540" HostedInRadWindow="true"  BodyCssClass="" />
    In the project you will find the implementaion of the field. The EditorContentManagerDialog as well as the MediaContentSelectorView need the control implementaion to run.
    EditorContentManagerDialog opens the dialog in RadWindow (this si how dialogs are opened in Sitefinity). The RadWindow calls the dialog code file which loads the  Dialog template (.ascx) and the .js file that provides functionality.
    It is important to note a call to the dialog needs to be made from Global.asax as you can also observe in the project.

    Best wishes,
    Stanislav Velikov
    the Telerik team
    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