Hi,
I have a webform where on one of the button click, I have to pop up another form, and on that pop up form, whatever user selects, need to add to the parent form grid. Now I am able to update parent page grid by calling parent page code behind function but the problem is that after that function call, the pop up screen is closed even though I dont have any code to close it down.
So simply, on my pop up page, I am storing something on session, on one of its button click, I am calling function to execute parent page's code behind function, ACTUALLY I am calling one of the button's click event. Everything works fine except the Pop up window close down after I call this function and I donot want it to be closed. I want to refresh parent grid and want to keep pop up window open.
Any suggestion ?
Here is my code. Although I copied it almost from telerik samples, please do let me know what changes do I need to make in order to keep the pop up open even after parent page's function is called.
#########################################################################################################
#########################################################################################################
Thanks in advance,
I have a webform where on one of the button click, I have to pop up another form, and on that pop up form, whatever user selects, need to add to the parent form grid. Now I am able to update parent page grid by calling parent page code behind function but the problem is that after that function call, the pop up screen is closed even though I dont have any code to close it down.
So simply, on my pop up page, I am storing something on session, on one of its button click, I am calling function to execute parent page's code behind function, ACTUALLY I am calling one of the button's click event. Everything works fine except the Pop up window close down after I call this function and I donot want it to be closed. I want to refresh parent grid and want to keep pop up window open.
Any suggestion ?
Here is my code. Although I copied it almost from telerik samples, please do let me know what changes do I need to make in order to keep the pop up open even after parent page's function is called.
#########################################################################################################
-- SCRIPTS OF PARENT PAGE
function OpenPopup(currentVersion) {
var widthVal = 750;
var heightVal = 700;
var oWnd = radopen("Components.aspx?v=" + currentVersion, "RadWindow1");
oWnd.setSize(heightVal, widthVal);
//set a function to be called when RadWindow is closed
oWnd.add_close(OnClientClose);
return false;
}
function OnClientClose(oWnd) {
//get the transferred arguments
document.getElementById("btnSearchComponent").click();
}
function CalledFn() {
document.getElementById("btnSearchComponent").click();
}
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
ReloadOnShow
=
"true"
ShowContentDuringLoad
=
"false"
Skin
=
"Default"
KeepInScreenBounds
=
"true"
VisibleStatusbar
=
"false"
>
<
windows
>
<
telerik:RadWindow
runat
=
"server"
ID
=
"RadWindow1"
Width
=
"800"
Height
=
"500"
Behaviors
=
"Move,Close"
Modal
=
"true"
NavigateUrl
=
"Components.aspx"
AutoSize
=
"false"
OnClientClose
=
"OnClientClose"
>
</
telerik:RadWindow
>
</
windows
>
</
telerik:RadWindowManager
>
ON MY POP UP PAGE ( CHILD PAGE )
<
script
language
=
"javascript"
type
=
"text/javascript"
>
function CloseForm() {
window.opener.document.getElementById("btnSearchComponent").click();
}
</
script
>
<
asp:Button
runat
=
"server"
ID
=
"btnAddProduct"
Text
=
"Add"
CssClass
=
"ButtonCSS"
onclick
=
"btnAddProduct_Click"
Width
=
"350px"
/>
CODE BEHIND TO CALL ABOVE FUNCTION AFTER PERFORMING CERTAIN TASKS AND TO STORE MY VALUES IN SESSION
protected void btnAddProduct_Click(object sender, EventArgs e)
{
// I PERFORM CERTAIN TASKS HERE
ClientScript.RegisterClientScriptBlock(this.GetType(), "myscript", @"<
script
>CloseForm();</
script
>");
}
#########################################################################################################
Thanks in advance,