Hello,
I am using a RadPrompt window to accept some basic information, which I then pass back to the server for a lengthy task. I am using the __doPostBack method to post the RadPrompt results to the server. I want to invoke the RadAjaxLoadingPanel to show I am busy while the server task completes and posts the results. My code is not working - I do not see the "loading" panel. The RadPrompt works fine, passing the desired result to the server. How can I make the RadAjaxLoadingPanel appear?
I have attached an image of the ascx code. Note that RadAjaxLoadingPanel1 and RadAjaxPanel1 are defined in code behind of the parent web part and work when other controls are pressed.
Code that defines RadAjaxLoadingPanel1 and RadAjaxPanel1
01.RadAjaxLoadingPanel radAjaxLoadingPanel = new RadAjaxLoadingPanel();02.radAjaxLoadingPanel.ID = "RadAjaxLoadingPanel1";03.radAjaxLoadingPanel.Skin = "Windows7";04.radAjaxLoadingPanel.MinDisplayTime = 500;05.radAjaxLoadingPanel.Transparency = 30;06. 07.Controls.Add(radAjaxLoadingPanel);08. 09._radAjaxPanel = new RadAjaxPanel();10._radAjaxPanel.ID = "RadAjaxPanel1";11._radAjaxPanel.LoadingPanelID = "RadAjaxLoadingPanel1";12. 13.// load these controls14._docSearchUserControl = Page.LoadControl(_ascxPath) as DocSearchUserControl;15._docSearchUserControl.ID = "DocSearchUserControl";16._docSearchUserControl.ParentWebPart = this; // add reference to this web part
JS code that calls RadPrompt and tries to show the RadAjaxLoadingPanel1 over RadAjaxPanel2 (see the attached image to see how RadAjaxPanel2 is defined)
function ExportFilesRadButton_Clicked(sender, args) { //debugger; var path = document.getElementById(sender.get_id()).getAttribute("Path"); // Path is set on server if (path) { OpenFileExportPrompt(path); } } function OpenFileExportPrompt(path) { radprompt('Server Path:', FileExportPromptCallBackFn, 330, 100, null, 'Server Target Location', path); } function FileExportPromptCallBackFn(arg) { // alert ("Prompt returned the following result: " + arg); //debugger; if (arg != null) { currentLoadingPanel = $telerik.$("[id$='RadAjaxLoadingPanel1']").get(0).control; // to avoid 'not found' error currentUpdatedControl = $find("<%= RadAjaxPanel2.ClientID %>"); if (currentLoadingPanel && currentUpdatedControl) { //alert("controls found"); //show the loading panel over the updated control currentLoadingPanel.show(currentUpdatedControl); } __doPostBack("FileExportPrompt", arg); } }</script></telerik:RadCodeBlock>