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

Forums / Developing with Sitefinity / Setting imageurl of hyperlink not reflecting

Setting imageurl of hyperlink not reflecting

4 posts, 0 answered
  1. Roland
    Roland avatar
    45 posts
    Registered:
    23 Feb 2009
    15 Apr 2009
    Link to this post

    I have a usercontrol where it has a public Hyperlink property which I can set to the WebEditor of the usercontrol once I uploaded it to sitefinity. Upon setting the imageurl of the hyperlink in the webeditor i will have to click the select button for me to browse the image file. After I selected the image then click done, the image will not take effect on the usercontrol and once i reopen again the webeditor and to see if the imageurl is set, it is empty. But things work fine once i redo the scenario and then putting the focus of the cursor to the textbox of imageurl and then add some space at the end of the entry. Is this a bug or is there some tweaks to it so it will work correctly?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    16 Apr 2009
    Link to this post
    Hi Roland,

    Could you tell us which control you use and version of Sitefinity. It you have implemented the control would you mind sending us the code, so that we could check it locally.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Roland
    Roland avatar
    45 posts
    Registered:
    23 Feb 2009
    17 Apr 2009
    Link to this post
    The code behind is just adding a get property to a hyperlink.

    public HyperLink Link 
      get 
      { 
        return this.hlLink; 
      } 

    That's just it and then follow the these steps.

    1.On editpage mode drag the your user control that contains that property above.
    2. Then edit the properties of that user control that you drag.
    3. Click the button beside the "Link" to open another pop window to edit the Hyperlink's properties.
    3. Set the "imageurl" of the "Link" by clicking the button beside it to browse for an image. 
    4.After you have selected an image click "i'm done" to close the 2nd popup window and then click again "i'm done" to close the 1st window.

    Notice the imageurl that you set did not take effect on your control.

    Then after that Repeat all the steps above but this time after you choose an image which is on step(3) add some space on the end part of the textbox where the imageurl was set.

    I'm using 3.5 Community Version
  4. Dido
    Dido avatar
    149 posts
    Registered:
    24 Sep 2012
    21 Apr 2009
    Link to this post
    Hello Roland,

    I would advise you to use the new 3.6 sp1.

    Here is a sample code that works under 3.6sp1
    using System; 
    using System.ComponentModel; 
    using Telerik.Cms.Web.UI; 
     
    [DefaultProperty("MyName")] 
    public partial class UserControls_Tickets_PropertiesNotSaving : System.Web.UI.UserControl 
        protected void Page_Load(object sender, EventArgs e) 
        { 
     
        } 
     
        [Category("Example")] 
        public string MyName 
        { 
            get 
            { 
                return this.myName.Text; 
            } 
            set 
            { 
                this.myName.Text = value; 
            } 
        } 
     
        [Category("Example")] 
        [WebEditor("Telerik.Cms.Web.UI.CmsUrlWebEditor, Telerik.Cms")] 
        public string Url 
        { 
            get
            set
        } 

    And the template:
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="PropertiesNotSaving.ascx.cs" Inherits="UserControls_Tickets_PropertiesNotSaving" %> 
     
    <asp:Label ID="myName" runat="server" /> 


    Sincerely yours,
    Dido
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered