Feel this problem is frequently asked, in fact, this is not a difficult problem ah, the index of their own tidy up a bit, convenient rookie reference it. Pop-up message dialog box in ASP, the confirmation dialog box can be referenced.
The simplest way to pop up a message box is to have just one sentence of code:
Response.Write (' You are a big fool! ') ("Javascript:alert");
Or:
. Attributes.Add ("Onclike", "Return confirm" (' Are you OK? '));
Page.registerstartupscript ("", "");
If you want to eject the confirmation dialog box, you can change the Page.registerstartupscript ("", "") to confirm, like this:
Page.registerstartupscript ("", "");
A more complex way to pop up a message box, you can also refer to:
System.Windows.Forms.dll
Using System.Windows.Forms.MessageBox;
Then use: MessageBox.Show (), for example:
MessageBox.Show ("You must enter the content!", "Name Entry Error", MessageBoxButtons.OK, messageboxicon.exclamation); BUTTON1.ATTRIBUTES.ADD ("Onclike", "return confirm (' You confirm this operation? ')");
OK, these are relatively simple methods, I believe it will be very practical for asp.net novice, try it yourself.