Hi, I have an issue that I can't solve with RadWindow and RadAjaxManager
When the user closes a RadWindow after editing something (for example editing an appointment from RadGrid or editing a row from RadSchedule), and clicks the OK button (that does something server side with a callback in C#), the control will postback despire RadAjaxManager setting. This is very annoying because the page is entirely redrawn.
When the user open the popup (that is also a server side event) RadAjaxManager works correctly and postback does not happen.
Any Idea?
This is my scenario taken by the example of editing a radschedule with a custom radwindow popup:
Radmanager is
Here is the RadWindow:
Here is the Callback used to open the popup (that works with ajax)
And Here is the callback that does not work.. because every time it closes the popup it will redraw the entire page:
Where am I Wrong? The same behaviour happens with the RadGrid. I suppose it is a wrong AjaxManager Setting.. but I read carefully and I didn't find nothing for my scenario.
Thanks for any help
When the user closes a RadWindow after editing something (for example editing an appointment from RadGrid or editing a row from RadSchedule), and clicks the OK button (that does something server side with a callback in C#), the control will postback despire RadAjaxManager setting. This is very annoying because the page is entirely redrawn.
When the user open the popup (that is also a server side event) RadAjaxManager works correctly and postback does not happen.
Any Idea?
This is my scenario taken by the example of editing a radschedule with a custom radwindow popup:
Radmanager is
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadScheduler1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"calendarPopup"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"btnOk"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadScheduler1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"btnCancel"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadScheduler1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
Here is the RadWindow:
<
telerik:RadWindow
ID
=
"calendarPopup"
runat
=
"server"
Skin
=
"Windows7"
AutoSize
=
"True"
Animation
=
"Fade"
EnableShadow
=
"True"
Modal
=
"True"
Opacity
=
"100"
>
<
Localization
Maximize="<%$ Resources:RadWindow, Maximize %>" Minimize="<%$ Resources:RadWindow, Minimize %>"
Close="<%$ Resources:RadWindow, Close %>" PinOff="<%$ Resources:RadWindow, PinOff %>"
PinOn="<%$ Resources:RadWindow, PinOn %>" Reload="<%$ Resources:RadWindow,Reload %>"
Restore="<%$ Resources:RadWindow, Restore%>" Cancel="<%$ Resources:RadWindow, Cancel %>" />
<
ContentTemplate
>
<
table
width
=
"100%"
>
<
tr
>
<
td
>
<
asp:Literal
ID
=
"lblAppointmentName"
runat
=
"server"
Text
=
"Nome del Calendario"
></
asp:Literal
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
asp:TextBox
ID
=
"txtAppointmentName"
runat
=
"server"
Width
=
"250px"
></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
asp:Literal
ID
=
"lblAppointmentDescription"
runat
=
"server"
Text
=
"Descrizione Evento"
></
asp:Literal
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
asp:TextBox
ID
=
"txtAppointmentDescription"
runat
=
"server"
Width
=
"250px"
TextMode
=
"MultiLine"
Height
=
"200"
></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"float: right;"
>
<
br
/>
<
telerik:RadButton
ID
=
"btnOk"
runat
=
"server"
Text
=
"Salva"
OnClick
=
"btnOk_Click"
Skin
=
"Windows7"
>
<
Icon
PrimaryIconCssClass
=
"rbOk"
PrimaryIconLeft
=
"4"
PrimaryIconTop
=
"4"
/>
</
telerik:RadButton
>
<
telerik:RadButton
ID
=
"btnCancel"
runat
=
"server"
Text
=
"Annulla"
OnClick
=
"btnCancel_Click"
Skin
=
"Windows7"
>
<
Icon
PrimaryIconCssClass
=
"rbCancel"
PrimaryIconLeft
=
"4"
PrimaryIconTop
=
"4"
/>
</
telerik:RadButton
>
</
td
>
</
tr
>
</
table
>
</
ContentTemplate
>
</
telerik:RadWindow
>
Here is the Callback used to open the popup (that works with ajax)
protected
void
RadScheduler1_FormCreating(
object
sender, SchedulerFormCreatingEventArgs e)
{
e.Cancel =
true
;
switch
(e.Mode)
{
case
SchedulerFormMode.AdvancedEdit:
case
SchedulerFormMode.Edit:
{
calendarPopup.Title =
"Edit Appointment"
;
// Edit inizializing code here
}
break
;
case
SchedulerFormMode.AdvancedInsert:
case
SchedulerFormMode.Insert:
{
calendarPopup.Title =
"Create Appointment"
;
txtAppointmentName.Text = String.Empty;
txtAppointmentDescription.Text = String.Empty;
}
break
;
}
//This will open the popup!
string
script =
"function f(){$find(\""
+ calendarPopup.ClientID +
"\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
;
ScriptManager.RegisterStartupScript(Page, Page.GetType(),
"key"
, script,
true
);
}
And Here is the callback that does not work.. because every time it closes the popup it will redraw the entire page:
protected
void
btnCancel_Click(
object
sender, EventArgs e)
{
//This will close the popup!
string
script =
"function f(){$find(\""
+ calendarPopup.ClientID +
"\").hide(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
;
ScriptManager.RegisterStartupScript(Page, Page.GetType(),
"key"
, script,
true
);
}
protected
void
btnOk_Click(
object
sender, EventArgs e)
{
//This will close the popup!
string
script =
"function f(){$find(\""
+ calendarPopup.ClientID +
"\").hide(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
;
ScriptManager.RegisterStartupScript(Page, Page.GetType(),
"key"
, script,
true
);
//Creating or Saving appointment here
}
Where am I Wrong? The same behaviour happens with the RadGrid. I suppose it is a wrong AjaxManager Setting.. but I read carefully and I didn't find nothing for my scenario.
Thanks for any help