Continuous pop-up window in Ajax

Source: Internet
Author: User

The page style is:

The left Ajax container is the function tree, and the right Ajax container is the details of a node in the function tree.

The Ajax container on the right contains a connection, which is used to open a pop-up window to further display the affiliated content of a node in the function tree.

The click event on the right side of the figure that links "This test point step information" is:

Scriptmanager. registerstartupscript (updatepanel1, GetType (), "onclick", "showtab ('" + hiddpropid. Value + "')", true );

Open the pop-up page, where hiddpropid is a hidden control, and its value is the ID value of the node currently clicked in the function tree.

Problem: The first click of the link can be displayed, but the next click cannot be displayed. (it may be because the Ajax container has not been refreshed. You can solve this problem by refreshing it, however, the current page and function tree expand node status may be affected, so the solution is not refreshed .)

Use solutions for this problem:

You cannot click the link in the background code to enable the pop-up window function. Because the Ajax container is not updated, the background is not called. Therefore, you should try to open the pop-up window in the foreground:

That is, add the call foreground event in the link: onclientclick = 'showtab ()'

The JS event is:

Function showtab (){
// Document. getelementbyid ("lnktab"). Click ();
VaR id = Document. getelementbyid ('hiddpropid '). value;
Pop = new popup ({contenttype: 1, isreloadonclose: false, width: 600, height: 500 });
Pop. setcontent ("title", "test point step ");
Pop. setcontent ("contenturl", "testtabmanage. aspx? Itemid = "+ id );
Pop. Build ();
Pop. Show ();
// Window. showmodaldialog ('testtabmanage. aspx? Itemid = '+ id, '', 'dialogheight: 500px; dialogwidth: 600px; center: Yes; left: 0; toolbar: No; Location: Yes; menubar: No; scrollbars: yes; resizable: No; Status: no ');

}

Obtain the value of 'ddpropid 'in the JS event, that is, the ID value of the function tree node. the pop-up window is displayed.

Other questions:

In onclientclick = 'showtab (<% = ID %>) ', ID is set as the id value of the function tree node in the background. This value is directly used when the js method is called. However, the debugging result is as follows: the actual id value is not obtained, but (<% = ID %>) is passed as a String constant.

Unsolved problem: Why not parse (<% = ID %> )?

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.