The "OK" dialog box is displayed:
Response. Write ("<script language = JavaScript> alert ('message! '); </SCRIPT> ");
The "OK" dialog box is displayed. Click to jump to the page:
Response. Write ("<script language = JavaScript> alert ('message! '); Window. navigate (' ../index. aspx '); </SCRIPT> ");
The "OK" and "cancel" dialog boxes are displayed. Click "OK" to perform the following operations:
Method 1: In the page_load event, write button1.attributes ["onclick"] = "javascript: Return confirm ('Are you sure you want to delete it? '); ", And then write your execution in the button1_onclick eventCode.
Method 2: write data directly in the button1_onclik event
Response. Write ("<script language = JavaScript> If (confirm ('Are you sure you want to delete it? ') {Window. navigate ('dodelete. aspx ') ;}</SCRIPT> "); method 2 needs to jump to another page to perform the operation, which is a little more complicated than method 1, but how to use it depends on the specific situation.