Hello,
I need some help for showing and closing a RadWindow server-side without any postbacks.
The RadWindow is always added to the page (CreateChildControls):
It should open in the click event handler of a RadRibbonBar;
Currently, the RadWindow only contains a simple button which should close the RadWindow:
Note: The code which is executed when the RadRibbon bar's click event is handled is also executed after a postback (I save to the viewstate if I have to reopen the RadWindow).
My problem is: the RadWindow opens correctly, but clicking the close button does the first time I click nothing and the second time I click a full page reload. How do I have to open the RadWindow (and keep it open after a postback) and how do I close it without a complete page reload?
Thanks for your help!
Edit: Executing the javascript only when the RadWindow is opened from the click event (and not from another postback) resolves the problem that I have to click twice to close it. But closing still does a full page reload.
I need some help for showing and closing a RadWindow server-side without any postbacks.
The RadWindow is always added to the page (CreateChildControls):
m_overlayWindow =
new
RadWindow();
m_overlayWindow.ID =
"m_overlayWindow"
;
m_overlayWindow.Behaviors = WindowBehaviors.None;
m_overlayWindow.AutoSize =
true
;
m_overlayWindow.VisibleOnPageLoad =
false
;
Controls.Add(m_overlayWindow);
RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
AjaxSetting ajaxSetting1 =
new
AjaxSetting(m_ribbonBar.ID);
ajaxSetting1.UpdatedControls.Add(
new
AjaxUpdatedControl(
this
.ID, LoadingPanel.ID) { UpdatePanelHeight =
new
Unit(
"100%"
) });
manager.AjaxSettings.Add(ajaxSetting1);
It should open in the click event handler of a RadRibbonBar;
m_overlayWindow.Modal =
true
;
m_overlayWindow.VisibleOnPageLoad =
true
;
RadButton buttonClose =
new
RadButton();
buttonClose.ID =
"bclose"
;
buttonClose.Text =
"Close"
;
buttonClose.Value =
"close"
;
buttonClose.Click +=
new
System.EventHandler(buttonClose_Click);
m_overlayWindow.ContentContainer.Controls.Add(buttonClose);
string
script =
"function f(){$find(\""
+ m_overlayWindow.ClientID +
"\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
;
FmWebUtil.RegisterStartupScript(
this
.Page,
"key"
, script,
true
);
RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
manager.AjaxSettings.AddAjaxSetting(m_overlayWindow,
this
, LoadingPanel);
Currently, the RadWindow only contains a simple button which should close the RadWindow:
void
buttonClose_Click(
object
sender, System.EventArgs e)
{
m_overlayWindow.VisibleOnPageLoad =
false
;
}
Note: The code which is executed when the RadRibbon bar's click event is handled is also executed after a postback (I save to the viewstate if I have to reopen the RadWindow).
My problem is: the RadWindow opens correctly, but clicking the close button does the first time I click nothing and the second time I click a full page reload. How do I have to open the RadWindow (and keep it open after a postback) and how do I close it without a complete page reload?
Thanks for your help!
Edit: Executing the javascript only when the RadWindow is opened from the click event (and not from another postback) resolves the problem that I have to click twice to close it. But closing still does a full page reload.