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

Forums / Developing with Sitefinity / Uploading image problem

Uploading image problem

5 posts, 0 answered
  1. Rick
    Rick avatar
    29 posts
    Registered:
    28 Oct 2009
    28 Jan 2010
    Link to this post
    Hi,

    I have implemented image upload section(imageuploadbefore.jpg in the attached files) based on this article http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-associate-content-items-with-files.aspx.

    When I upload an image for the first time, Upload window appears(uploadimagewindow.jpg in attached files)
    and no problem at all.
    Then, [Provider]Guid value is stored in the textbox(imageuploadafter.jpg in the attached files).
    When I click on the select button again, Preview window appears with the image and being able to change the image file(imagepreview.jpg in the attached files).

    The problem happens when I refresh the page, or go to edit mode.
    [Provider]Guid value is still there, but when I click on the select button, it shows Upload window rather than Preview window.

    Is this a bug or am I missing something?

    Thanks,
  2. Rick
    Rick avatar
    29 posts
    Registered:
    28 Oct 2009
    28 Jan 2010
    Link to this post
    Please refer to these files and ignore above attached file.
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    28 Jan 2010
    Link to this post
    Hello Rick,

    Try using ButtonSelector

    <li class="selector">
                        <asp:Label ID="Label2" AssociatedControlID="Photo" runat="server"><asp:Literal ID="Literal14" runat="server" Text="<%$Resources:Photo%>"></asp:Literal> <em id="PhotolLabel" runat="server"></em></asp:Label>
                        <asp:TextBox ID="Photo" Text="" runat="server" MaxLength="250"></asp:TextBox>
                        <sfLib:ButtonSelector WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx" ItemTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/Dialogs/ButtonSelector.ascx" AssociatedControls="Photo" runat="server" cssclass="pickerWrapper" ButtonText="<%$Resources:Select%>" />
                        <p class="example">
                            <asp:Literal ID="Literal15" runat="server" Text="<%$Resources:PhotoNote %>"></asp:Literal>
                        </p>
                    </li>

    Also you need to perform page post back to refresh the dialog.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  4. Rick
    Rick avatar
    29 posts
    Registered:
    28 Oct 2009
    28 Jan 2010
    Link to this post
    Hi,

    I actually tried using ButtonSelector as below..but no luck
    <%@ Register TagPrefix="sfLib" Namespace="Telerik.Libraries.WebControls" Assembly="Telerik.Libraries" %> 
     
    ...  
     
    <asp:Label AssociatedControlID="Image" runat="server">    
                                <asp:Literal runat="server" Text="<%$Resources:Image %>"></asp:Literal>    
                                <em id="ImageLabel" runat="server"></em></asp:Label>    
                                <asp:TextBox ID="Image" runat="server" MaxLength="250"></asp:TextBox>    
                                <sfLib:ButtonSelector WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx"   
                                    AssociatedControls="Image" ItemTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/Dialogs/ButtonSelector.ascx"   
                                    runat="server" cssclass="pickerWrapper" ButtonText="Select" />   

    Even though I can retrieve Preview by setting page post back, I still have a problem with Edit mode.
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    28 Jan 2010
    Link to this post
    Hi Rick,

    The select button forces the upload function, not preview, by calling the ButtonSelector control. You could try the following

    1. Add an Image Control  near the selector, resolve the dynamic url and display the image.

    2. Create another button which will open a RadWindow which will be actually "preview" of the images. You have to resolve the dynamic url.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
5 posts, 0 answered