This is a migrated thread and some comments may be shown as answers.

Can't send ImageUrl to radWindow

1 Answer 74 Views
Window
This is a migrated thread and some comments may be shown as answers.
mromani
Top achievements
Rank 1
mromani asked on 25 Sep 2008, 06:59 PM
Hi, Im using 'Returning Values from a Dialog Demo' in my project, but i can't get asp:Image.ImageUrl and send it to radWindow.  That work fine with textarea, but not with Images. I think that problem its in javascript. There are same way to send this value?

            function showDialog() 
            {                     
                //Force reload in order to guarantee that the onload event handler of the dialog which configures it executes on every show. 
                var oWnd = window.radopen(null"DialogWindow"); 
                oWnd.setUrl(oWnd.get_navigateUrl()); 
            } 
             
            //Called when a window is being shown. Good for setting an argument to the window  
            function OnClientshow(radWindow) 
            {                     
                //Get current content of textarea 
                var oText = document.getElementById("ImageFoto1"); 
                 
                //Create a new Object to be used as an argument to the radWindow 
                var arg = new Object();                     
                //Using an Object as a argument is convenient as it allows setting many properties. 
                arg.ImageUrl = oText.ImageUrl;  // This don't work 
       
                                     
                //Set the argument object to the radWindow         
                //radWindow.Argument = arg; 
                radWindow.Argument = arg; 
            } 


Thanks for your support.

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 26 Sep 2008, 10:20 AM
Hi mromani,

The described problem is not directly related to RadWindow but to general JavaScript knowledge. You cannot take an asp:image' image url by using such syntax - this property is undefined and that is why you cannot extract it.

The correct way to extract the image's url is the following one:

var imageUrl = document.getElementById('ImageFoto1').attributes["src"].value; 



Best wishes,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
mromani
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or