CheckBoxList多選樣式j(luò)query、C#獲取選擇項
更新時間:2013年09月06日 11:52:48 作者:
使用jquery、C#獲取CheckBoxList選擇項,實現(xiàn)如下,感興趣的朋友可以參考下
復(fù)制代碼 代碼如下:
.checkboxlist label
{
margin-right: 20px;
}
復(fù)制代碼 代碼如下:
var label;
$("#ddlplatform input:checkbox:checked").each(function () {
label += $(this).next().html();
});
復(fù)制代碼 代碼如下:
<asp:CheckBoxList ID="ddlplatform" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"
CssClass="checkboxlist">
<asp:ListItem Value="APP">APP</asp:ListItem>
<asp:ListItem Value="移動觸屏">移動觸屏</asp:ListItem>
<asp:ListItem Value="PC">PC</asp:ListItem>
<asp:ListItem Value="微信">微信</asp:ListItem>
<asp:ListItem Value="微博">微博</asp:ListItem>
</asp:CheckBoxList>
復(fù)制代碼 代碼如下:
//使用平臺
string Platfrom = string.Empty;
foreach (ListItem li in this.ddlplatform.Items)
{
if (li.Selected)
{
Platfrom += li.Text + ",";
}
}
Platfrom = Platfrom.TrimEnd(',');
相關(guān)文章
jQuery手動點(diǎn)擊實現(xiàn)圖片輪播特效
這篇文章主要為大家詳細(xì)介紹了jQuery手動點(diǎn)擊實現(xiàn)圖片輪播特效,手動點(diǎn)擊數(shù)字卡片實現(xiàn)圖片輪播,對圖片輪播感興趣的小伙伴們可以參考一下2015-12-12
JavaScript的jQuery庫插件的簡要開發(fā)指南
這篇文章主要介紹了JavaScript的jQuery庫插件的簡要開發(fā)指南,分為基于選擇器的插件和不基于選擇器的插件兩種情況,需要的朋友可以參考下
2015-08-08
jqeury eval將字符串轉(zhuǎn)換json的方法
這個方法是一個將DataTable轉(zhuǎn)換成字符串的方法 。
2011-01-01 
