I solved the problem by entering data in the pop-up window. After saving, the upper parent window can be refreshed. I wrote JavaScript on the ASP page.CodePut the <SCRIPT>
Function showitem ()
{
Window. showmodaldialog ('a2. aspx ', null, 'dialogwidth: 600px; dialogheight: 500px; dialogleft: 300px; dialogtop: 400px; resizable: Yes; Status: no ');
_ Dopostback ('refresh ','')
Return true;
}
</SCRIPT>
Refresh is a linkbutton. Click to execute a databind ()
There is no problem with the code. I have read many examples, many of which are written in this way. But _ dopostback ('refresh', '') is not executed. It is really strange. I have no time to study why ??
Later I saw an example,
Transfer arguments between modal page and invoker page in Asp.net 1.1
Http://www.codeproject.com/useritems/modalpageinaspnet.asp
It is to place this javscript on the server side code and register it through registerstartupscript.
Place the following code in the parent window Click Event
Protected void add_click (Object sender, eventargs E)
{
String strscript = "<SCRIPT> \ n" +
"Var strreturn = Window. showmodaldialog ('a2. aspx ', 'desc', 'dialogwidth: 423px; dialogheight = 355px'); \ n" +
"_ Dopostback ('refresh', strreturn);" +
"</SCRIPT> ";
If (! This. isclientscriptblockregistered ("opendialogscript "))
This. registerstartupscript ("opendialog", strscript );
}
We found that _ dopostback ('refresh', '') can be executed.
I don't know why. I just need to use it and I don't have time to study it. If you have any experts, please advise.