Hi,
I have adapted the load on demand demo to show a confirmation box before load the next control. If the control currently loaded is in "Edit mode" i want to show a confirmation box, so i use the following code:
If the user click yes then i initiate an Ajax request to load the user control.
I also have the following RadAjax Settings on page:
If i debug the code i can see the control is loaded and added correctly, but nothing happens on the page. Any tips on load user controls in the ManagerAjaxRequest method?
Thanks.
I have adapted the load on demand demo to show a confirmation box before load the next control. If the control currently loaded is in "Edit mode" i want to show a confirmation box, so i use the following code:
protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
{
if
(isEdit)
{
RadTabStrip1.FindTabByText(LatestMenuItem).Selected =
true
;
RadAjaxManager manager = RadAjaxManager.GetCurrent(
this
.Page);
manager.ResponseScripts.Add(
"if(confirm('Are you sure?'))"
+ manager.ClientID +
".ajaxRequest('tab')"
);
}
else
{
LatestMenuItem = e.Tab.Text;
string
ctrl = e.Tab.Attributes[
"ctrl"
] +
".ascx"
;
LoadUserControl(ctrl,
false
);
e.Tab.Selected =
true
;
}
}
If the user click yes then i initiate an Ajax request to load the user control.
protected void ManagerAjaxRequest(object sender, AjaxRequestEventArgs e)
{
LoadUserControl(NewControlName,
true
);
}
I also have the following RadAjax Settings on page:
<
telerik:RadAjaxManagerProxy
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadTabStrip1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadTabStrip1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"Panel1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadTabStrip1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"Panel1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
If i debug the code i can see the control is loaded and added correctly, but nothing happens on the page. Any tips on load user controls in the ManagerAjaxRequest method?
Thanks.