本帖最后由 gzldtec 于 2011-03-11 16:15:24 编辑

解决方案 »

  1.   

    动态添加的,你可以遍历表单
    for(int i = 0;i<Request.Form.Count;i++) Response.Write("<li>" + Request.Form.Keys[i].ToString() + " = " + Request.Form[i].ToString()); 
      

  2.   

    添加的时候是循环纪录,获取的时候像1楼那样遍历post过来的表单
    不过有些并不是<input type=text  ../>的控件也会post过来(比如提交的按钮),所以最好动态添加的时候给你要取值的控件ID加个特殊的标记,比如$dynamicInput$什么的
    然后遍历时判断Request.Form.GetKey(i).Contains("$dynamicInput$");
    由于控件嵌套会影响在客户端的最终命名,所以最好用Contains(),而且标记要弄特殊一点
      

  3.   

    谢谢 net_lover 和 dongxinxi
     for (int i = 0; i < Request.Form.Count; i++) 
         Response.Write("<li>" + Request.Form.Keys[i].Contains("$C3T4L5$").ToString() + " = " + Request.Form[i].Contains("$C3T4L5$").ToString());
          
    Contains() 获取到的结果是 
    False = False
    True = False
    True = Falsedongxinxi 怎么回事呢?