Hello all,
I have really two problems, but they are connected to each other, so I will explain both in this thread.
Problem 1 - Loading panel - Master Page
I have been at this for a while, and even though I am following the code sample from here: http://www.telerik.com/help/aspnet-ajax/ajax-show-loadingpanel-on-initial-pageload.html the Loading Panel is not working.
Code for Main.Master:
Code for Main.Master.vb:
Symptoms:
Code for Content.aspx.vb:
Symptoms:
On the initial page load (I haven't gotten to the point where I have any PostBack on the Content page yet), the NeedDataSource event will not fire.
The solution I found was to call the Grid's Rebind() method on the Content page's Page_Load method. However, I am not sure that this is correct. To me it seems an unnecessary action. And I had to use a Hidden Field so that I could check whether or not it's been called so that I don't do any unnecessary rebinds, and it only happens on the initial page load.
Can anyone help?
Thanks!!!
I have really two problems, but they are connected to each other, so I will explain both in this thread.
Problem 1 - Loading panel - Master Page
I have been at this for a while, and even though I am following the code sample from here: http://www.telerik.com/help/aspnet-ajax/ajax-show-loadingpanel-on-initial-pageload.html the Loading Panel is not working.
Code for Main.Master:
<
telerik:RadCodeBlock
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function pageLoad(sender, eventArgs) {
if (!eventArgs.get_isPartialLoad()) {
$find("<%=RadAjaxManager1.ClientID%>").ajaxRequest("InitialPageLoad");
}
}
.....
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
></
asp:ScriptManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"MainContentPanel"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
......
<
div
id
=
"mainContent"
>
<
section
class
=
"container-content"
>
<
div
class
=
"bottom-container-content"
>
<
div
class
=
"content-page"
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
></
telerik:RadAjaxLoadingPanel
>
<
asp:Panel
ID
=
"MainContentPanel"
runat
=
"server"
>
<
asp:Panel
ID
=
"AjaxMainContentPanel"
runat
=
"server"
Visible
=
"false"
>
<
asp:ContentPlaceHolder
ID
=
"MainContent"
runat
=
"server"
></
asp:ContentPlaceHolder
>
</
asp:Panel
>
</
asp:Panel
>
.......
Code for Main.Master.vb:
Private
Sub
RadAjaxManager1_AjaxRequest(sender
As
Object
, e
As
Telerik.Web.UI.AjaxRequestEventArgs)
Handles
RadAjaxManager1.AjaxRequest
If
e.Argument =
"InitialPageLoad"
Then
AjaxMainContentPanel.Visible =
True
End
If
End
Sub
Symptoms:
Although the page seems to load in the correct order, master and content page layout, menus, images, etc... the RadAjaxLoadingPanel does not show.
I have a RadGrid on the content page being loaded from some very heavy queries which can take up to 5 seconds, and the place where the grid would show is blank until the data is loaded.
Problem 2 - RadGrid's NeedDataSource event will not fire with the above scenario:
Code for Content.aspx:
<
asp:Content
ID
=
"Content3"
ContentPlaceHolderID
=
"MainContent"
runat
=
"server"
>
<
telerik:RadAjaxManagerProxy
ID
=
"AjaxManagerProxy1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"AjaxManagerProxy1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"rdList"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
<
telerik:RadGrid
ID
=
"rdList"
runat
=
"server"
AllowPaging
=
"False"
Skin
=
"Silk"
AllowMultiRowSelection
=
"true"
AutoGenerateColumns
=
"false"
>
<
MasterTableView
>
<
Columns
>
.....
Code for Content.aspx.vb:
Private
Sub
rdList_NeedDataSource(sender
As
Object
, e
As
Telerik.Web.UI.GridNeedDataSourceEventArgs)
Handles
rdList.NeedDataSource
LoadGrid()
End
Sub
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
If
Not
Page.IsPostBack
Then
Else
If
PageIsLoaded.Value <>
"true"
Then
rdList.Rebind()
PageIsLoaded.Value =
"true"
End
If
End
If
End
Sub
Symptoms:
On the initial page load (I haven't gotten to the point where I have any PostBack on the Content page yet), the NeedDataSource event will not fire.
The solution I found was to call the Grid's Rebind() method on the Content page's Page_Load method. However, I am not sure that this is correct. To me it seems an unnecessary action. And I had to use a Hidden Field so that I could check whether or not it's been called so that I don't do any unnecessary rebinds, and it only happens on the initial page load.
Can anyone help?
Thanks!!!