Control Designer, setting image src issue

Posted by Community Admin on 03-Aug-2018 21:00

Control Designer, setting image src issue

All Replies

Posted by Community Admin on 04-Oct-2011 00:00

Hi team!

I'm having an issue at the moment I set the ImageSrc of an <asp:ImageButton> control in a UserControl Designer.js

the issue is that when the controlData.SrcImagen value haven't been changed, even when the image is a new one (but with the same name) the backend doesn't show the new image

,
    applyChanges: function ()
        var controlData = this._propertyEditor.get_control();
        controlData.Link = jQuery(".DropLinkPages option:selected").val();
        controlData.SrcImagen = "~/UserControls/ucBannerImg/imgBanner.jpg"; //jQuery("#SrcImagen").val();
        controlData.LboxWidth = jQuery("#LboxWidth").val();
        controlData.LboxHeight = jQuery("#LboxHeight").val();
        controlData.LinkTarget = jQuery("#LinkTarget").val();       
    ,
    get_controlData: function ()
        return this.get_propertyEditor().get_control();

¿How can I force the backend updates the image of the ImageButton after the applyChanges() function?

Thanks in advance

Posted by Community Admin on 07-Oct-2011 00:00

Hi Mario,

You have a correct applyChanges: function ()so I think the issue is caused by the duplicated ID`s (LboxWidth, LboxHeight, LinkTarget). Can you test with changing the ID`s of the duplicated controls?

All the best,
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

Posted by Community Admin on 04-Nov-2011 00:00

Hi Stanislav


I encounter this issue again, and still can't solve it
Can you explain me what you mean with "Duplicated ID's" ... to me; the ids are different.


thanks
-mario-

Posted by Community Admin on 09-Nov-2011 00:00

Hello Mario,

Can you check with this applyChanges() element of your designer controlData.LboxWidth = jQuery("#LboxWidth").val();
do you have set public string LboxWidth get; set; in Template_Name.ascx.cs and in Page_Load LboxWidth.Text(or Image or ImageMap depends on the type of control you created) = LboxWidth; Also can you put a breakpoint in the start of applyChanges function to see if the script tries to apply changes and what is causing the problem if no change is applied.

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

This thread is closed