日期:2014-05-17 浏览次数:20372 次
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default9.aspx.cs" Inherits="test8_Default9" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .style1 { width: 100%; } </style> <script src="../js/Demonstrate/jquery-1.4.1-vsdoc.js" type="text/javascript"></script> </head> <body> <form id="form1" runat="server"> <div> <% for (int i = 0; i < 3; i++) { %> <table class="style1"> <tr> <td> <input type="button" value="Add" id= "btnAdd_<%=i %>" onclick="showInfo(<%=i %>)" /> </td> <td> </td> </tr> </table> <%} %> </div> </form> </body> </html> <script type="text/javascript"> function showInfo(num) { alert(num); } </script>
------解决方案--------------------
<asp:Button ID="Button1" runat="server" Text="Button" onclick="btn_Click" /> <asp:Button ID="Button2" runat="server" Text="Button" onclick="btn_Click" />
------解决方案--------------------
textbox.Text += "你选择的值"+"<br/>" textbox在这里的作用无非就是展示用的,就是为了显示你选择的内容,用label或者其他控件都可以实现