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

Incremental Page fetch

1 Answer 57 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Marco Basta
Top achievements
Rank 1
Marco Basta asked on 24 Mar 2008, 06:22 PM
I am trying to implement something very similar to this article:
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


1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 Mar 2008, 10:13 AM
Hi Marco,

Actually your code is working properly on my end. I am attaching a sample VS2008 site that shows this. Give it a spin and let us know of the result on your end.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Marco Basta
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or