To implement this function, select a drop-down box on the. ASPX page and find that there is no required option. Therefore, you need to add a sub-page B. aspx. Click Add to open the sub-page B. aspx. On the B. ASPX page, close the B. ASPX page and refresh the drop-down box of the. ASPX page.
The implementation method is: jquery combined with showmodaldialog. Open the B. ASPX page in showmodaldialog mode. After the B. ASPX page operation is complete, return a value to A. aspx to determine whether to refresh the page.
A. The key code of aspx is as follows:
- <SCRIPT type = "text/JavaScript">
- Function openwin ()
- {
- VaR width = 320;
- VaR Height = 100;
- VaR url = 'addcustorm. aspx ';
- VaR returnval;
- Returnval = Window. showmodaldialog (URL, '', 'dialogwidth = '+ width + 'px; dialogheight =' + height + 'px; resizable = no; help = no; center = yes; status = no; scroll = no; edge = sunken ');
- If (returnval = "true") // The home page is not refreshed when the X of the direct vertex mode form is closed.
- {
- $ (Document). Ready (function (){
- $ ("# SC"). Load ("getcustorm. aspx ");
- });
- }
- }
- </SCRIPT>
B. key code of the ASPX page:
B. After the event handler of Aspx. CS is added successfully
Response. Write ("<SCRIPT> ");
Response. Write ("window. returnvalue = 'true'; window. Close ();");
Response. Write ("</SCRIPT> ");