give the control an ID in CreateChildControls(), then usethis.FindControl(TheID) 
in btnSub_Click (assume it is a method in the custom control itself)

解决方案 »

  1.   

    思归大哥,我是用的这种办法。可是当我读取 过滤下拉控件“MetaBuilders.WebControls.ComboBox”时用SelectedValue属性时,有时返回空字符串,如下:
    row_new[col_name] = ((MetaBuilders.WebControls.ComboBox)this.FindControl(TheID).SelectedValue
    用DropDownList时却没有发生这种情况。而“MetaBuilders.WebControls.ComboBox”的Text属性却正确,就是有关“Selected”的属性为空。
    所以我想问有没有其它的办法,谢谢!
      

  2.   

    >>>有时返回空字符串??you mean sometimes it doesn't return 空字符串? it seems MetaBuilders.WebControls.ComboBox didn't override SelectValue property
      

  3.   

    是的,MetaBuilders.WebControls.ComboBox 回填“SelectValue”属性吗?我想应该回填吧,可是有时明明"Text"属性可就是用户选的,可是“SelectValue”属性的值却是 ""
      

  4.   

    可以设置属性来读,下拉列表框一开始读可能会是NULL(当下拉列表框DropDownList绑定数据时),所以可以加个异常处理.