Hello,
I have a MDI web form and dynamically creating new radwindows inside that MDI form. I want to some operations on close (X) of that window. For that i have added RadWindow1.OnClientClose = "OnClientCloseClick"; . In OnClientCloseClick event, i have called __doPostBack() in order to implement my logic. On closing window, postback is working. But when i am checking Request.Form["__EVENTTARGET"] , it's value becomes null. When i am doing the same in a normal aspx page(no windowmanager here), it is showing some value.
In MDI form i have added new window dynamically.
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
RadWindow RadWindow1 = new RadWindow();
RadWindow1.ID = "RadWindow1";
RadWindow1.VisibleOnPageLoad = true;
RadWindow1.OnClientClose = "OnClientCloseClick";
RadWindow1.NavigateUrl = String.Format("Default.aspx?ID=" + Request.QueryString["ID"]);
RadWindowManager1.Windows.Add(RadWindow1);
}
}
JS
function OnClientCloseClick(sender, args) {
__doPostBack('SaveSettingOnClose', 'OnClose');
}
function __doPostBack(eventTarget, eventArgument) {
document.Form1.__EVENTTARGET.value = eventTarget;
document.Form1.__EVENTARGUMENT.value = eventArgument;
document.Form1.submit();
}
HTML
<input type="hidden" name="__EVENTTARGET" value="">
<input type="hidden" name="__EVENTARGUMENT" value="">
---------------
In Default.aspx (new window created)
in page load
if (Request.Form["__EVENTTARGET"] == "SaveSettingOnClose")
{
SaveSettingOnClose();
}
Here Request.Form["__EVENTTARGET"] becomes null. so control is not going inside the if block.
Please provide me solution to solve this issue.
Thanks
Abhi
I have a MDI web form and dynamically creating new radwindows inside that MDI form. I want to some operations on close (X) of that window. For that i have added RadWindow1.OnClientClose = "OnClientCloseClick"; . In OnClientCloseClick event, i have called __doPostBack() in order to implement my logic. On closing window, postback is working. But when i am checking Request.Form["__EVENTTARGET"] , it's value becomes null. When i am doing the same in a normal aspx page(no windowmanager here), it is showing some value.
In MDI form i have added new window dynamically.
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
RadWindow RadWindow1 = new RadWindow();
RadWindow1.ID = "RadWindow1";
RadWindow1.VisibleOnPageLoad = true;
RadWindow1.OnClientClose = "OnClientCloseClick";
RadWindow1.NavigateUrl = String.Format("Default.aspx?ID=" + Request.QueryString["ID"]);
RadWindowManager1.Windows.Add(RadWindow1);
}
}
JS
function OnClientCloseClick(sender, args) {
__doPostBack('SaveSettingOnClose', 'OnClose');
}
function __doPostBack(eventTarget, eventArgument) {
document.Form1.__EVENTTARGET.value = eventTarget;
document.Form1.__EVENTARGUMENT.value = eventArgument;
document.Form1.submit();
}
HTML
<input type="hidden" name="__EVENTTARGET" value="">
<input type="hidden" name="__EVENTARGUMENT" value="">
---------------
In Default.aspx (new window created)
in page load
if (Request.Form["__EVENTTARGET"] == "SaveSettingOnClose")
{
SaveSettingOnClose();
}
Here Request.Form["__EVENTTARGET"] becomes null. so control is not going inside the if block.
Please provide me solution to solve this issue.
Thanks
Abhi