Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
Finally, I started to write the B/S program.
Today I encountered a problem: how to handle the modal dialog box. The specific requirements are as follows: click "add" on the selection page to bring up the modal dialog box. After adding a record in the dialog box, select "OK" to close the dialog box, update the data in the table on the home page.
There are many discussions on the modal dialog box on the internet. I tried it for a day and found a better solution:
1. Displayed dialog box:
Function OpenEditWin (frmWin, width, height)
// Pass the parent page window object as a parameter to the dialog box, so that the dialog box can manipulate the parent page to automatically refresh.
Me = window;
// Display the dialog box.
Window. showModalDialog (frmWin, me, 'dialogwidth = '+ width + 'px; dialogHeight =' + height + 'px; help: no; status: no ')
Call in C:
Many methods are implemented using Response. Write or RegisterStartupScript, but they all have problems, such as the blank page when the dialog box is displayed and the pop-up dialog box when the page is refreshed.
Add a jscript to the dialog box
Session ["showForm"] is the aspx file name in the dialog box. The content is very simple. Some text boxes are designed on the page for users to enter relevant information, as well as the "OK" and "cancel" buttons, when the "OK" button is selected, save the data in the text box to the database, and close the dialog box. If the "cancel" button is selected, the operation is canceled.
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.