webform开发经验(一):Asp.Net获取Checkbox选中的值
生活随笔
收集整理的這篇文章主要介紹了
webform开发经验(一):Asp.Net获取Checkbox选中的值
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
webform中獲取repeat控件列表下的checkbox選中的值:
碼農上代碼:
public static string getSelectedIDs(Repeater Rpt_){string res = string.Empty;foreach (RepeaterItem rtpItem in Rpt_.Items){HtmlInputCheckBox obj = rtpItem.FindControl("checkbox") as HtmlInputCheckBox;if (obj != null){if (obj.Checked == true){res += obj.Value.ToString() + ",";}}}if (!string.IsNullOrEmpty(res)){res = res.Remove(res.LastIndexOf(','));}return res;}?
轉載于:https://www.cnblogs.com/benpao/p/3976007.html
總結
以上是生活随笔為你收集整理的webform开发经验(一):Asp.Net获取Checkbox选中的值的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Server-Side UI Autom
- 下一篇: HBase理解