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

Can I show the RadAjaxLoadingPanel with client side ?

3 Answers 284 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Winson qiu
Top achievements
Rank 1
Winson qiu asked on 07 Oct 2009, 07:05 AM
I just want to show the RadAjaxLoadingPanel with client side and not used AJAX , just like a loop in javascript, I have tried the follows method, but did not worked.

function Test() { 
                var currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID %>"); 
                currentLoadingPanel.show("<%= Panel1.ClientID %>"); 
                for (var i = 0; i < 1000; i++) { 
                     //test code ... 
                } 
                currentLoadingPanel.hide("<%= Panel1.ClientID %>"); 
            }   

Does the RadAjaxLoadingPanel support this ? or only can used with AJAX ?

Thanks!


3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 07 Oct 2009, 08:02 AM
Hi Winson qiu,

Your code should work. Please review the following example:

<%@ Page Language="C#" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> 
<title>RadControls for ASP.NET AJAX</title> 
</head> 
<body> 
<form id="form1" runat="server"
<asp:ScriptManager ID="ScriptManager1" runat="server" /> 
 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="50" BackColor="Yellow" /> 
 
<asp:Panel ID="Panel1" runat="server"
aaaaa 
</asp:Panel> 
 
<script type="text/javascript"
 
Sys.Application.add_load(Test); 
 
function Test() 
{  
    var currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID %>");  
    currentLoadingPanel.show("<%= Panel1.ClientID %>");  
 
</script> 
 
</form> 
</body> 
</html> 


Best wishes,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Winson qiu
Top achievements
Rank 1
answered on 07 Oct 2009, 08:19 AM
I know what the problem with my code , because I used  currentLoadingPanel.hide("<%= Panel1.ClientID %>");
in the same process,  it would be run the hide immediately, so I can not see the loading, it should be used multithreading in javascript for this.

I am very glad, if you have a good idea for this.

Anyway, thanks for your help!
0
Dimo
Telerik team
answered on 07 Oct 2009, 10:18 AM
Hi Winson qiu,

Well, you should use setTimeout to hide the loading panel.

Sincerely yours,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Ajax
Asked by
Winson qiu
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Winson qiu
Top achievements
Rank 1
Share this question
or