ASP. NET dialog box
In ASP. NETProgramIn the development process, you often need to give a prompt to the user, such as whether the operation is "successful", "OK" or "cancel.
(1) click the button on the page and a dialog box is displayed, prompting whether to "OK" or "cancel". We can add attributes to the button to complete the operation:
Example:
Public System. Web. UI. webcontrols. Button btndelrow;
Btndelrow. Attributes. Add ("onclick", "Return confirm ('Are you sure you want to delete it? ');");
(2) After completing an operation on the page, a dialog box is displayed, prompting whether the operation is successful ".
Example:
Response. Write ("<SCRIPT> alert ('deleted successfully! ') </SCRIPT> ");
(3) Allow the ASP. NET Server Control to issue client script blocks in the page:
Public Virtual void registerstartupscript (string key, string script );
Example:
If (! This. isstartupscriptregistered ("hello "))
This. registerstartupscript ("hello", "<SCRIPT> alert ('Hello! ') </SCRIPT> ");