public partial class checkbox : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
string con = ConfigurationSettings.AppSettings["myconection"];
string select = "select name from ID";
string str = string.Empty;
SqlConnection conn = new SqlConnection(con);
SqlDataAdapter myda = new SqlDataAdapter(select,conn);
DataTable mydt = new DataTable();
conn.Open();
try
{
DataSet myds = new DataSet();
myda.Fill(myds);
mydt = myds.Tables[0];
for (int i = 0; i <mydt.Columns.Count; i++)
{
foreach(DataRow dr in mydt.Rows)
{
str += "<input type=checkbox value='"+dr[i]+"'>'"+dr[i]+"'<p>";
}
}
str += "<input type=button value='确定' id='button'>";
Response.Write("");
}
finally
{
conn.Close();
Label1.Text = str;
}
}
}
}
这个是我写的多选框都是写在后台的
我现在想在点击BUTTON按扭后获得选定的值
应该怎么办