B/S is not like C/S. A MessageBox can pop up a prompt box. However, you can use JS's "alert" to pop up messages, or use some variant JS methods. I would like to introduce you to the following categories.
Four pop-up boxesCode:
Protected Void Message_click ( Object Sender, eventargs e ){ // First Response. Write ( " <Script language = JavaScript> alert ('first pop-up box '); </ " + " SCRIPT> " ); // Second Page. registerstartupscript ( "" , " <Script language = 'javascript '> window. Alert ('second pop-up box'); </SCRIPT> " ); // Third Clientscriptmanager scriptmanager =(Page) system. Web. httpcontext. Current. Handler). clientscript; scriptmanager. registerstartupscript ( Typeof ( String ), "" , " Alert ('third pop-up box '); " , True ); // Fourth Page. clientscript. registerstartupscript (page. GetType (), " Message " , " <Script language = 'javascript 'defer> alert ('Fourth pop-up box'); </SCRIPT> " );}
The above four methods are very simple. In fact, the simpler method is to encapsulate them into a method as follows.
// Dialog Box Public Void Alert ( String Str_message ){ // First Response. Write ( " <Script language = JavaScript> alert ('first pop-up box '); </ " + " SCRIPT> " ); // Second Page. registerstartupscript ( "" , " <Script language = 'javascript '> window. Alert ('second pop-up box'); </SCRIPT> " ); // Third Clientscriptmanager scriptmanager = (Page) system. Web. httpcontext. Current. Handler). clientscript; scriptmanager. registerstartupscript ( Typeof ( String ), "" , " Alert ('third pop-up box '); " , True ); // Fourth Page. clientscript. registerstartupscript (page. GetType (), " Message " , " <Script language = 'javascript 'defer> alert ('Fourth pop-up box'); </SCRIPT> " );}
When the usage frequency is relatively high, it is very convenient. You only need "alert. Is it convenient? If you think it is good, just give it a try.