There is now a parent page. The IFRAME embedded window (page B) appears when you click the button, for example:
The function we want to implement is to send the selected information from the pop-up window B to homepage a and process the information when you click OK.
First, define the following function for sending back on page:
<Script Type= "Text/JavaScript">
FunctionRebind (ID ){
_ Dopostback ('Ctl00 $ pagebody $ linkbutton1', ID );//Simulate the send-back event of the call button and input a value. Obtain the Client ID of the button.
Tb_remove ();//How to close the pop-up window
}
</Script>
< ASP : Linkbutton ID= "Linkbutton1" Runat= "Server" Onclick= "Linkbutton#click"> </ASP:Linkbutton>
In the background of page A, click the button to send back the event:
//Bound question name
Protected VoidLinkbutton#click (ObjectSender,EventargsE)
{
IntCdid =Int. Parse (request. Form ["_ Eventargument"]. Tostring ());// QuestionID, which is the parameter of the frontend sending back.
/* Processing Method */
}
Event triggered when you click OK on page B:
//OK
Protected VoidButton#click (ObjectSender,EventargsE)
{
StringId = hfepid. value;//Obtain the selectedIDValue
StringSTR ="Window. Parent. rebindpaper ('"+ ID +"');";//Call the parent page binding method
Scriptmanager. Registerstartupscript (This. Page,Type. GetType ("System. String"), STR, STR,True);
}
In addition, you can also use the ajaxpro control to call the server-side functions from the client. For details, see:
Http://www.cnblogs.com/shawker/archive/2011/01/13/1934560.html