The window. showmodaldialog () method cannot be used in chrome.

Source: Internet
Author: User

1. Use window. open () to replace the pop-up window.

2. Use getbrowsertype () to determine the current browser and handle it accordingly.

Function getbrowsertype (){

VaR UA = navigator. useragent. tolowercase ();

If (UA. Match (/MSIE ([\ D.] +)/) return 1;

If (UA. Match (/Firefox \/([\ D.] +)/) return 2;

If (UA. Match (/chrome \/([\ D.] +)/) return 3;

If (UA. Match (/opera. ([\ D.] +)/) return 4;

If (UA. Match (/version \/([\ D.] +). * Safari/) return 5;

Return 0;

}

3. ie uses window. returnvalue to pass parameters to the parent window;

Chrome uses window. opener. returnvalue to pass parameters to the parent window, and CALLS window extension opener.doc ument. All. btngetlist. Click (); partial comfort parent window.

4. Define a control in the parent window <input type = "hidden" id = "btngetlist" onclick = "<% = PostBack () %>"/>

5. Define the PostBack () method in the background of the parent window.

Protected string PostBack ()

{

Return this. Page. getpostbackeventreference (this. hidadd, "getlist ");

}

Hidadd triggers the following events

Protected void btnadd_click (Object sender, eventargs E)

{

This. getlist ();

}

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.