The UI control under jquery seems to be faulty. One day I debug a jquery dialog from AM until AM. At that time, I placed a server button in the dialog and bound the button to an event processing function in codebehind. However, the strange thing is that I didn't respond to the subsequent event functions when I clicked the button, I went crazy.
After dawn, Google finally found the reason: jquery will append the dialog element to the body, rather than form, and it is sweating. Millions of people who use jquery UI are overwhelmed, so they trust the jquery UI team too much.
I found three solutions:
1st methods:
Code: $ ("# dialog"). Parent (). appendto ("/html/body/form [0]");
2nd methods:
Add a div such as <Div id = "dialog_target"> </div> and write the dialog into the div.
$ ("# Dialog"). Parent (). appendto ("# dialog_target ");
3rd methods:
1. Modify the dialog JS Code and add the code to the form instead of the body.
2. The custom HTML in dialog is not used, but an IFRAME is directly added to move the HTML in it to another page, interaction with the parent page is OK (this method is used, so that the independent code can be reused)
I use 2nd methods. server events can be responded to, and the results are also good.
Http://douyunliang.blog.sohu.com/129047116.html