Recently, an access project was migrated to Asp.net + sqlserver. In this case, in a button event of the access form, CodeThis is basically the function: In the pop-up modal dialog box, after closing the dialog box, continue with a piece of database operation code.
The pop-up modal dialog box in Asp.net is easy, but the server code will be executed after the modal dialog box is closed. This requires that the page be submitted immediately after the dialog box is closed. So we have the following solutions.
Drag the server button in the web form, and assume that the button ID is btncomput. In the page_load file on the hidden page, use the following code:
Btncomput. attributes ("onclick") = "window. showmodaldialog ('') ". The parameter is the Web form of the dialog box.
Execute the database operation code after the dialog box is closed in btncomput server events.
When you click btncomput, the client Javascript is executed first. After the modal dialog box is displayed, the page is not submitted. After the dialog box is closed, JavaScript is executed, and then the web page is submitted, continue to execute server events. In this way, the buttons in access are implemented together with the client code and the server Event code.
I hope to give some reference to my friends who are doing similar projects.