<% @ Page Language = "C #" %> <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <SCRIPT runat = "server"> // attaches a value to the commandargument attribute of the button protected void button#click (Object sender, eventargs e) {This. button. commandargument = "button";} protected void button_click (Object sender, eventargs e) {// print the commandargument attribute response of the button. write (button) sender ). com Mandargument);} protected void button2_click (Object sender, eventargs e) {response. write ("Wang AI Hui client conform");} protected void button3_click (Object sender, eventargs e) {response. write ("Wang AI Hui arrisponconform");} // You can pass the attributes attribute of the button to add a confirmation dialog box to the button. Protected void page_load (Object sender, eventargs e) {This. button3.attributes. add ("onclick", "Return confirm ('arrisponconfrim Are you true ') "); // button7.attributes. add ("onmouseover", "currentcolor = This. style. backgroundcolor; this. style. backgroundcolor = 'blue' "); // button7.attributes. add ("onmouseout", "this. style. backgroundcolor = currentcolor ");} protected void buttons_command (Object sender, commandeventargs e) {If (E. commandname = "B4") {response. write ("select top 10 * From mytable order by ID" + E. commandargument );} If (E. commandname = "B5") {response. write ("select top 10 * From mytable2 order by name" + E. commandargument);} If (E. commandname = "B6") {response. write ("select top 10 * from" + E. commandargument + "order by id desc ");}} </SCRIPT> <HTML xmlns = "http://www.w3.org/1999/xhtml">