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

adding conditionalPostback js to a dynamically loaded usercontrol

1 Answer 45 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Shane P
Top achievements
Rank 1
Shane P asked on 05 Dec 2008, 07:54 PM
Hi there,
Hoping someone can help me out with a problem I am having.
I have an aspx page which contains a placeholder which I use to display usercontrols.
My aspx contains a RadAjaxPanel and my placeholder is inside the panel. I have set the panels 

 

ClientEvents-OnRequestStart="conditionalPostback" and I have added some js

 

 

function conditionalPostback(sender, e) {

 

 

 

var uploadButton = new RegExp("\.btnInsertStolenItem$", "ig");

 

 

// var upload = $find(window['radUploadImages']);

 

 

 

 

 

//var upload = $find('<%=radUploadImages.ClientID %>');

 

 

 

 

 

if (e.get_eventTarget().match(uploadButton)) {

 

 

// if (upload.getFileInputs()[0].value != "") {

 

 

 

 

e.set_enableAjax(

false);

 

 

// }

 

 

 

 

}

 

}

My problem is with my var upload. My aspx cant find radUploadImages (which I understand as it hasn't been loaded yet :)) however I dont know what to change to only set the var if the usercontrol has been loaded....

Hope this makes sense as I am really stuck.

If anyone could provide help I would be most grateful.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 08 Dec 2008, 05:30 PM
Hello Shane,

Could you please provide more details about your scenario? It would be helpful if we know the location of your RadUpload control (in the page or in the user control) as same as the location of the code you already shared with us.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Shane P
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or