Jquery learning notes-jquery uses showmodaldialog to partially refresh the parent page of a child page

Source: Internet
Author: User

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:

 

  1. <SCRIPT type = "text/JavaScript">
  2. Function openwin ()
  3. {
  4. VaR width = 320;
  5. VaR Height = 100;
  6. VaR url = 'addcustorm. aspx ';
  7. VaR returnval;
  8. Returnval = Window. showmodaldialog (URL, '', 'dialogwidth = '+ width + 'px; dialogheight =' + height + 'px; resizable = no; help = no; center = yes; status = no; scroll = no; edge = sunken ');
  9. If (returnval = "true") // The home page is not refreshed when the X of the direct vertex mode form is closed.
  10. {
  11. $ (Document). Ready (function (){
  12. $ ("# SC"). Load ("getcustorm. aspx ");
  13. });
  14. }
  15. }
  16. </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> ");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.