Hi guys,
After searching through many topics and trying different code snippets we still are not able to update a TextBox on the parent page when the RadWindow is closed.
We are currently using C# 2010 asp.net ajax controls.
Parent page code from where the rad window is being opened.
Page which is opened inside the RadWindow
Pretty much what happens is that when a user enters text into the textbox and clicks the btnCheckDB button some processing takes place in the code behind. the returned value from the database must be sent through to the parent page and the tbConsumerInfo TextBox must be updated with this data once the RadWindow is closed.
Please would you provide some feed back on how we would achieve this.
Thank you in advance.
After searching through many topics and trying different code snippets we still are not able to update a TextBox on the parent page when the RadWindow is closed.
We are currently using C# 2010 asp.net ajax controls.
Parent page code from where the rad window is being opened.
<!-- Parent Page -->
<
body
id
=
"Body1"
>
<
form
id
=
"form1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function getCookie()
{
if (document.cookie.length > 0) {
var c_name = "ConsumerID";
c_start = document.cookie.indexOf(c_name + "=");
if (c_start != -1)
{
c_start = c_start + c_name.length + 1;
c_end = document.cookie.indexOf(";", c_start);
if (c_end == -1)
{
c_end = document.cookie.length;
}
return unescape(document.cookie.substring(c_start, c_end));
}
}
return "";
}
function OpenConsumerWindow() {
var oWnd = $find('<%= FormView1.FindControl("ConsumerWindow").ClientID %>');
oWnd.setUrl('ConsumerIssue.aspx?ConsumerID=' + getCookie());
oWnd.show();
oWnd.maximize();
}
</
script
>
<
asp:FormView
ID
=
"FormView1"
runat
=
"server"
DataKeyNames
=
"ItemID"
GridLines
=
"None"
OnItemCommand
=
"FormView1_ItemCommand"
Width
=
"100%"
>
<
EditItemTemplate
>
<
div
>
<
table
>
<
tr
>
<
td
>
<
telerik:RadTextBox
ID
=
"tbConsumerInfo"
runat
=
"server"
EmptyMessage
=
"No Consumer"
ReadOnly
=
"true"
BackColor
=
"LightYellow"
style
=
"float:right;"
></
telerik:RadTextBox
>
</
td
>
<
td
>
<
telerik:RadButton
ID
=
"btnAddConsumer"
runat
=
"server"
Width
=
"16px"
Height
=
"16px"
AutoPostBack
=
"false"
style
=
"padding-top:-5px;float:right;"
ToolTip
=
"Add/Edit Consumer"
CausesValidation
=
"false"
OnClientClicked
=
"OpenConsumerWindow"
Visible
=
"false"
>
<
Image
ImageUrl
=
"Images/icons/ClipboardPlus.png"
IsBackgroundImage
=
"true"
/>
</
telerik:RadButton
>
</
td
>
</
tr
>
</
table
>
</
div
>
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
Behaviors
=
"None"
RenderMode
=
"Lightweight"
ShowContentDuringLoad
=
"false"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"ConsumerWindow"
runat
=
"server"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
</
EditItemTemplate
>
</
asp:FormView
>
</
form
>
</
body
>
Page which is opened inside the RadWindow
<!-- Page inide of radwindow -->
<
body
id
=
"ConsumerBody"
>
<
div
id
=
"MainDiv"
>
<
table
>
<
tr
>
<
td
>
<
telerik:RadTextBox
ID
=
"tbConsumerInfo"
runat
=
"server"
ReadOnly
=
"true"
BackColor
=
"LightYellow"
></
telerik:RadTextBox
>
</
td
>
<
td
>
<
telerik:RadButton
ID
=
"btnCheckDB"
runat
=
"server"
AutoPostBack
=
"true"
CausesValidation
=
"true"
OnClick
=
"btnCheckDB_Click"
/>
</
td
>
</
tr
>
</
table
>
</
div
>
</
body
>
Pretty much what happens is that when a user enters text into the textbox and clicks the btnCheckDB button some processing takes place in the code behind. the returned value from the database must be sent through to the parent page and the tbConsumerInfo TextBox must be updated with this data once the RadWindow is closed.
Please would you provide some feed back on how we would achieve this.
Thank you in advance.