http://www.telerik.com/help/aspnet/ajax/?ajxShowLoadingPanelOnInitialPageLoad.html
The Ajax Request DOES reach the server (I put a break point which gets a hit everytime the page is loaded). But for some reason, the content of Panel2 does not show on the page. The content however is shown when I initially set the visible property of Panel2 to "true" (in aspx page)
I am using Prometeus controls in ASP.NET 3.5. Here is my page and its master page:
Master Page:
<form id="form1" runat="server">
<telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" Height="600" FullScreenMode="true">
<telerik:RadPane id="LeftPane" runat="server" width="22" scrolling="none">
<telerik:RadSlidingZone id="SlidingZone1" runat="server" DockedPaneId="LeftSlidingPane" width="22">
<telerik:RadSlidingPane id="LeftSlidingPane" title="Menu" runat="server" width="180" >
<table>
<tr> <td> Menu goes here</td> </tr>
</table>
</telerik:RadSlidingPane>
</telerik:RadSlidingZone>
</telerik:RadPane>
<telerik:RadPane id="MiddlePane" runat="server" Scrolling="Both" Height="600">
<table style="width:100%">
<tr> <td>Header Info userControl</td> </tr>
<tr> <td><asp:ContentPlaceHolder ID="MainContent" runat="Server" /></td> </tr>
</table>
</telerik:RadPane>
</telerik:RadSplitter>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
</form>
Main Page (ASPX):
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
<script type="text/javascript">
window.onload =
function()
{
setTimeout(
function(){
window["<%= RadAjaxManager1.ClientID %>"].AjaxRequest("InitialPageLoad");
}, 200);
}
</script>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="radAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="TabPanel" LoadingPanelID="AjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
few user controls go here <br />
<asp:Button ID="Button1" runat="server" Text="POSTBACK" />
<asp:Panel ID="TabPanel" runat="server">
<asp:Panel ID="Panel2" Visible="false" runat="server">
THIS IS WHAT I WANT TO SEE AFTER THE "InitialPageLoad" AJAX REQUEST
</asp:Panel>
</asp:Panel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px">
<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0px;" />
</telerik:RadAjaxLoadingPanel>
</asp:Content>
Main page code behind:
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
If e.Argument = "InitialPageLoad" Then
'simulate longer page load
System.Threading.Thread.Sleep(2000)
Panel2.Visible = True
End If
End Sub
What am I doing wrong?
Thanks
Marco