Problem: how to show a RadAjaxLoadingPanel from an ascx after a javascript _doPostBack
First I explain my situation…
Main page containing an ascx. In the main page I must have ajaxManager and ajaxLoadingPanel
ASPX
<
telerik:RadCodeBlock
ID
=
"RadCodeBlockMain"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
var currentLoadingPanel = null;
var currentUpdatedControl = null;
function RequestStart(sender, args) {
currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID %>");
currentUpdatedControl = "<%= Panel1.ClientID %>";
//show the loading panel over the updated control
currentLoadingPanel.show(currentUpdatedControl);
}
function ResponseEnd() {
//hide the loading panel and clean up the global variables
if (currentLoadingPanel != null)
currentLoadingPanel.hide(currentUpdatedControl);
currentUpdatedControl = null;
currentLoadingPanel = null;
}
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
/>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManagerMain"
runat
=
"server"
>
<
ClientEvents
OnRequestStart
=
"RequestStart"
OnResponseEnd
=
"ResponseEnd"
/>
</
telerik:RadAjaxManager
>
<
asp:Panel
ID
=
"Panel1"
runat
=
"server"
HorizontalAlign
=
"Center"
>
<
uc:polContainer
runat
=
"server"
ID
=
"polContainer1"
/>
</
asp:Panel
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
>
<
div
>
<
asp:Image
ID
=
"Image1"
runat
=
"server"
ImageUrl
=
"/ajax_loader.gif"
/>
</
div
>
</
telerik:RadAjaxLoadingPanel
>
ASCX
Based on several conditions I fill a literal with Html code loaded on code behind which represents my results which consists in a set of items each one having a clickable part (*Y). The goal is – by clicking an item – reload the result page (ascx) with other items using ajax.
I did that calling in *Y a javascript that performas a __dopostback. That works fine.
The question is how do I show the RadAjaxLoadingPanel when I perform the postback? ?
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function myFunct(id) {
__doPostBack ('<%=UpdatePanel1.ClientID%>', id);
}
</
script
>
</
telerik:RadCodeBlock
>
<
asp:UpdatePanel
ID
=
"UpdatePanel1"
runat
=
"server"
>
<
ContentTemplate
>
<
asp:Literal
ID
=
"LiteralResult"
runat
=
"server"
/>
</
ContentTemplate
>
</
asp:UpdatePanel
>
.vb
…
LiteralResult.text+=”<
a
onclick
=
""
myFunct('" & id & "')"" >" & here_text & "</
a
>"
…
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack Then
Dim passedTargetId As String = = Request.Params.Get("__EVENTTARGET")
Dim passedArgument As String = Request.Params.Get("__EVENTARGUMENT")
If passedTargetId = UpdatePanel1.ClientID Then
‘do something
End If
End If
End Sub
Thank you for your attention