日期:2014-05-17 浏览次数:20553 次
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem>餐饮业</asp:ListItem>
<asp:ListItem>食品业</asp:ListItem>
<asp:ListItem>运输业</asp:ListItem>
<asp:ListItem>贸易业</asp:ListItem>
</asp:CheckBoxList>
string svalue = "运输业,食品业";
string[] svalue_array = svalue.Split(',');
foreach (string item in svalue_array)
{
CheckBoxList1.SelectedValue = item;
}
public partial class test_js : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
CheckBoxBind(new string[] { "运输业", "食品业" });
}
private void CheckBoxBind(string[] checkstr)
{
for (int i = 0; i < chklist.Items.Count; i++)
{
for (int j = 0; j < checkstr.Length;&nbs