All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
delphi向一个文件中添加内容
C#基础学习,——,异步编程篇_.net资料_编程技术
PHP连接ACCESS数据库的类_[PHP教程]
Delphi执行sql server模糊查询
在ASP.NET程序中值得注意的两个地方_[Asp.Net教程]
c#中GDI+图形图像:GDI+中的多边形使用方法
整理:Apache+MySql+PHP的快速安装_php资料_编程技术
全面接触SQL语法(3)_[SQL,Server教程]
Windows XP&2003 IIS安装PHP&MySQL环境完全教程_[PHP教程]
PHP初学者14个典型疑难问题_[PHP教程]
Reading number is top 10 pictures
男人巳快沦落成动物了
代沟,真好
这才是真正的人体艺术2
Ashlynn Brooke photograph of a group1
The money of more than 100 countries and regions7
NeedWallpaper6
Kim jong il's mistress, national beauty JinYuJi actor1
Sora aoi after swimming
这才叫绝色美女2
China telecom 114 spokesman MeiYanXu2
Download software ranking
The cock of the Grosvenor LTD handsome
卡丁车单机版
Twenty piece of palm leaf
功夫熊猫2(下集)
Detective task-the top secret prostitution files
Unix video tutorial9
C++编程教程第三版
Unix video tutorial3
Tram sex maniac 2 (H) rar bag17
Proficient in JavaScript
归海一刀 published in(发表于) 2014/1/30 1:21:55 Edit(编辑)
asp.net控件CheckBoxList使用详解_[Asp.Net教程]

asp.net控件CheckBoxList使用详解_[Asp.Net教程]

asp.net控件CheckBoxList使用详解_[Asp.Net教程]
< asp:CheckBoxList ID = "cblJL" runat = "server" RepeatDirection="Horizontal" Width="100%">
< asp:ListItem>当前记录asp:ListItem>
< asp:ListItem>当前页asp:ListItem>
< asp:ListItem>全部记录asp:ListItem>
< /asp:CheckBoxList>

后台3种方式:
第一种:获得CheckBox的值

C#代码
string save_cblJL = "";

for (int i = 0; i < this.cblJL.Items.Count; i++)
{
if (this.cblJL.Items[i].Selected == true)
{
save_cblJL += this.cblJL.Items[i].Value + ",";
}
}
Response.Write(save_cblJL);
string save_cblJL = "";
for (int i = 0; i < this.cblJL.Items.Count; i++)
{
if (this.cblJL.Items[i].Selected == true)
{
save_cblJL += this.cblJL.Items[i].Value + ",";
}
}
Response.Write(save_cblJL);

第二种:获得CheckBox的值
C#代码
string str_Save_cblJL = "";
foreach (ListItem li in cblJL.Items)
{
if (li.Selected == true)
{
str_Save_cblJL += li.Value + ",";
}
}
Response.Write(str_Save_cblJL);
string str_Save_cblJL = "";
foreach (ListItem li in cblJL.Items)
{
if (li.Selected == true)
{
str_Save_cblJL += li.Value + ",";
}
}
Response.Write(str_Save_cblJL);
第三种:从后台给前台CheckBox赋值
C#代码
string strapp = "当前记录,当前页,全部记录,";
string[] strtemp = strapp.Split(’,’);
foreach (string str in strtemp)
{
for (int i = 0; i < cblJL.Items.Count; i++)
{
if (this.cblJL.Items[i].Value == str)
{
this.cblJL.Items[i].Selected = true;
}
}
}


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.