I have hit the following scenario which I have managed to strip out in to a small example. I have a radWindow that is opening a new aspx page. On that page the user needs to cause a number of postbacks; after a certain number of postbacks are made and the window is closed by the user the parent page loses all state. Any subsequent postback on the parent page results in all dropdowns losing their data, it also sometimes occurs with textbox values. This should explain it better:
This is the parent page:
This is the parent page:
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
script
type
=
"text/javascript"
>
function openRadWindow() {
var oWnd = radopen("/parts/test.aspx", "RadWindow1");
oWnd.setSize(850, 700);
oWnd.center();
}
</
script
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
asp:DropDownList
ID
=
"lstComponent"
runat
=
"server"
/>
<
asp:Button
ID
=
"btnReload"
runat
=
"server"
OnClick
=
"btnReload_Click"
/>
<
asp:Button
ID
=
"btnAddNew"
runat
=
"server"
Text
=
"Add New"
OnClientClick
=
"openRadWindow('', '', '', ''); return false;"
CssClass
=
"button small green"
/>
<
telerik:RadWindowManager
ShowContentDuringLoad
=
"false"
EnableShadow
=
"true"
InitialBehaviors
=
"Maximize"
ID
=
"RadWindowManager1"
runat
=
"server"
Behaviors
=
"Close"
>
</
telerik:RadWindowManager
>
</
form
>
</
body
>
</
html
>
This is the code behind:
This is the page that is opened:
And its code behind:
Now to make the issue occur perform the following steps:
This is a simplistic example but my parent page in my actual website has a number of dropdown controls all of which lose their state.
I am using version 2012.1.215.40.
Thanks,
Richard
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lstComponent.Items.Clear();
lstComponent.Items.Insert(0, new ListItem(QA.BLL.Common.Const.please_select, String.Empty));
}
}
This is the page that is opened:
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
script
type
=
"text/javascript"
>
function CloseAndRebind(args) {
//GetRadWindow().BrowserWindow.refreshGrid(args);
GetRadWindow().close();
}
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
function CancelEdit() {
GetRadWindow().close();
}
</
script
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Nothing"
OnClick
=
"Button1_Click"
/>
<
asp:Button
ID
=
"btnTest"
runat
=
"server"
OnClick
=
"btnTest_Click"
/>
</
div
>
</
form
>
</
body
>
</
html
>
And its code behind:
public partial class test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnTest_Click(object sender, EventArgs e)
{
int test = 1;
Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind('Rebind');", true);
}
protected void Button1_Click(object sender, EventArgs e)
{
btnTest.Text = DateTime.Now.ToShortTimeString();
}
}
Now to make the issue occur perform the following steps:
- press the btnAddNew button on the parent page to make the window appear
- on the window press Button1 a number of times (x10)
- Press the btnTest button to close the window
- Press the btnReload button on the parent page to force a postback
- The option that had been added to the dropdown is gone.
This is a simplistic example but my parent page in my actual website has a number of dropdown controls all of which lose their state.
I am using version 2012.1.215.40.
Thanks,
Richard