try to change
Dim Selname() As String
===>
Dim Selname(objDV.Count-1) As String

解决方案 »

  1.   

    to saucer
    能不能再问你个问题,就是:
    <Script Language="VB" Runat="Server">
       Sub Page_Load(sender As Object,e As EventArgs)
       Response.Write("<Td> <Input Type='CheckBox' Runat='Server' ID='CheckBox'&'I' OnServerChange='CheckBox_Clicked'/></Td>")
       End Sub
     </Script>
    刚开始我使用的是Response.Write("<Td> <ASP:CheckBox Runat='Server' ID='CheckBox&'I'' Checked='false' OnCheckedChanged='CheckBox_Clicked'/></Td>")
    但是不能显示,后来换为最上面的那个才能显示,但是我不知道是怎么回事。还有,checkbox的名字这样表示对不对?
    谢谢。
      

  2.   

    if you use Response.Write, the code is output to the client side, and will not be processed by the server,tryHtmlInputCheckBox cb = new HtmlInputCheckBox();
    cb.ID = "CheckBoxI";
    cb.Checked = false;
    cb.ServerChange += new EventHandler(CheckBox_Clicked);
    this.Controls[0].Controls.Add(cb); //or FormID.Controls.Add(cb);
      

  3.   

    不好意思,你的代码我有些看不懂。麻烦你,还有一个问题:
    For I=0 to objDV.Count-1 
       Response.Write("<Td Align=center> <Input Type='CheckBox' Runat='Server' ID='CheckBox'&'I' OnServerChange='CheckBox_Clicked'/></Td>") 
       Next 
    后来用的时候是这样引用的: 
    Dim K As integer 
        For k=0 to session("usernum") 
        If CheckBox"k".Checked 
         Then ……… 
         End If 
     Next  
    出错信息是CheckBox”是一个类型,不能用作表达式。指向If CheckBox"k".Checked 希望给些帮助,感激不尽。