Finally start writing B / S procedures.
I have encountered a problem today, how to handle the modal dialog. The specific requirements are: When the Add button on the selection page, pop up the Modal dialog box, after adding a record in the dialog, select the "OK" button, close the dialog, update the data of the homepage table.
There are a lot of discussions on the modal dialog in the Internet. I tried a day, I found a better solution:
1, display dialog:
in
Jet Javascript script files:
Function OpenEditwin (frmwin, width, height) {var me; // Parent Page Window Objects Transfer to the dialog box to the dialog box to manipulate the parent page. ME = window; // Displays the dialog. Window.ShowModaldialog (frmwin, me, 'dialogwidth =' width 'px; dialogheight =' height 'px; help: no; status: no')} In C #, call:
cmdadd.attributes.add ("Onclick", "JavaScript: Openeditwin ('" session ["Showform"] "', 540, 400)"); Many methods are implemented with Response.Write or RegisterStartupScript, but there is a problem, If the page is blank when the dialog box is displayed, the dialog box will pop up when the page is refreshed.
Add JScript scripts in the dialog
Posted on 2004-04-27 12:17 WLJCAN Reading (953) Comments (2) Edit Collection
comment
# Re: The modal dialog in ASP.NET From FeedDemon, you can see "Add a script in the dialog:" The part behind, but you can't see from IE. Can you explain the session [showform "]? This problem is confused for a long time.
2004-04-28 12:40 |
Li Teng
# Re: Modal dialog box in ASP.NET Session ["showform"] is the ASPX file name of the dialog, the content is very simple, and some text boxes are designed on the page, let the user enter the relevant information, and "determinate" And "Cancel" button, select the "OK" button to save the data in the text box to the database and close the dialog box, and the "Cancel" button will cancel the operation to close the dialog.
Can not be displayed in IE, it may be the problem of this site, you can go to another blog to see:
http://www.cnblogs.com/wljcan/archive/2004/04/27/7794.aspx