是不是C#人太少了?Asp.net的多一点?

解决方案 »

  1.   

    要查找出控件用findcontrol()就可以了
    至于验证那我就知道 怎么自动添加了 我想总要自己重新再写的
    当然要全部自己添加的话
    估计id要固定了
      

  2.   

    IEnumerator TempmyEnumerator = ((System.Web.UI.Page)ab).Controls[1].Controls.GetEnumerator(); 
    Control myControl = (Control) myEnumerator.Current
    控件类型 = Convert.ToString(myControl.GetType())
      

  3.   

    写个递归的function找。
    private void CollectControls(ControlCollection cc) {

    foreach(Control c in cc) {

    //Which Controls do we support?
    if (c is TextBox || 
    c is ListBox || 
    c is DropDownList || 
    c is RadioButton ||
    c is RadioButtonList ||
    c is CheckBox ||
    c is CheckBoxList ||
    c is BaseValidator ||
    c is Button)
    _ControlContainer.Rows.Add(new object[]{cc, c, cc.IndexOf(c)});

    //Are there further Controls inside current Control?
    if (c.HasControls())
    CollectControls(c.Controls);
    }

    }