using System.Data; using System .Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls ; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class CheckBoxList : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnOk_Click(object sender, EventArgs e) { int totalNum = 0;//Total number string list = "000"; //Selected value for (int i = 0; i < this.chkBox.Items.Count; i ) { if (chkBox.Items[i].Selected ) { totalNum = 1; list = "," chkBox.Items[i].Value; } } Response.Write(totalNum.ToString() " |" list); } }
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn