我在页面用checklist控件,在网上找了些代码如下: 但不懂得怎么获值 了, 我想这样 string Country1 = GetCtrlSelValue(Country,string text); 但是不知道第二个参数string text是填什么了?帮帮忙哦
public virtual string GetCtrlSelValue(Control listctrl, string type)
{
string str_Value = "";
switch (type)
{
//===要选择的是value===
case "value":
{ if (listctrl is CheckBoxList)
{
for (int i = 0; i < ((CheckBoxList)listctrl).Items.Count; i++)
{
if (((CheckBoxList)listctrl).Items[i].Selected == true)
{
str_Value = str_Value + ((CheckBoxList)listctrl).Items[i].Value + ",";
}
}
if (str_Value != "")
{
str_Value = str_Value.Substring(0, str_Value.Length - 1);
}
}
break;
} }
return str_Value; }
public virtual string GetCtrlSelValue(Control listctrl, string type)
{
string str_Value = "";
switch (type)
{
//===要选择的是value===
case "value":
{ if (listctrl is CheckBoxList)
{
for (int i = 0; i < ((CheckBoxList)listctrl).Items.Count; i++)
{
if (((CheckBoxList)listctrl).Items[i].Selected == true)
{
str_Value = str_Value + ((CheckBoxList)listctrl).Items[i].Value + ",";
}
}
if (str_Value != "")
{
str_Value = str_Value.Substring(0, str_Value.Length - 1);
}
}
break;
} }
return str_Value; }
解决方案 »
- FAXCOMLib 发送传真怎么判断发送状态
- 【问】如何实现修改数据库字段后,只需要改model而不用动bll跟dal层
- GridView怎样绑定不同表中的不同字段
- 问一个很菜的问题!
- ibatis连接mysql出错
- 求一正则表达式, 长度为10, 必须要有.字母,数字,和至少一位非字母数字的符号.
- 关于取出Menu控件Text值的求教,急
- WEB系统在EXCEL中加载图片的问题,请高手赐教.
- 服务端控件验证与自己写的javascript验证函数同时存在时出现的冲突问题
- 原来DLL文件也不怎么安全!
- 在DROPDOWNLIST 每一项左边加上一幅图片,谢谢
- 三层架构中,怎样让BLL,Model,DAL里的bin目录下的 dll文件自动更新到主项目里bin目录下的DLL文件?
肯定是填写value了