---
title: "循环增加checkboxlist的选项"
author: "bestsaler"
date: "2010-08-24T14:57:00Z"
tags: []
slug: "checkboxlist"
draft: false
lastmod: "2010-08-24T14:57:00Z"
id: 759090
url: "https://bestsaler.iteye.com/blog/759090"
---

循环增加checkboxlist的选项

public void  SelectListIndex(ListControl lc,string values)  
        {  
            string\[] tempValues = values.Split(',');  
            if (tempValues.Length &gt; 0)  
            {  
                foreach (string tempvalue in tempValues)  
                   lc.Items.Add(new ListItem(tempvalue ,tempvalue ));  
            }  
            
        }

&lt;script type="text/javascript"&gt;&lt;!-- google\_ad\_client = "pub-1985112462197986"; /* 728x90, 创建于 10-7-27 \*/ google\_ad\_slot = "9407691718"; google\_ad\_width = 728; google\_ad\_height = 90; //--&gt; &lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show\_ads.js"&gt; &lt;/script&gt;