新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
checkbox選中的值怎么利用WebForm進(jìn)行獲取-創(chuàng)新互聯(lián)
這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)?lái)有關(guān)checkbox選中的值怎么利用WebForm進(jìn)行獲取,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
1.前端頁(yè)面:
2.后臺(tái)方法:
#region 獲取從前端頁(yè)面回傳過(guò)來(lái)的 CheckBox 的值 void GetCheckBoxValue() ////// 獲取從前端頁(yè)面回傳過(guò)來(lái)的 CheckBox 的值 /// private void GetCheckBoxValue() { string user = Request["chk_per"]; string[] users = user.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries); string s = string.Empty; foreach (var item in users) { s += item + " | "; } } #endregionRequest.Form["chk_per"] 以逗號(hào)分割,獲取所有選中的 CheckBox 的值 ///
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { //測(cè)試調(diào)用 GetCheckBoxValue(); } }
上述就是小編為大家分享的checkbox選中的值怎么利用WebForm進(jìn)行獲取了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
網(wǎng)站標(biāo)題:checkbox選中的值怎么利用WebForm進(jìn)行獲取-創(chuàng)新互聯(lián)
網(wǎng)頁(yè)地址:http://www.dlmjj.cn/article/gghco.html