$("#btnAddImage").click(function(){
        $("#image_list").append("<input id=\"_ImageID_"+$(this).attr("fyVal")+"\" name=\"_ImageID_"+$(this).attr("fyVal")+"\" class=\"text_w3\" type=\"file\" />");
        $(this).attr("fyVal", $(this).attr("fyVal") * 1 + 1);
    });我动态生成file控件,到服务端获取
我这样写Request.Files.Count 获取不到提示都为0
客户端动态生成file控件 服务端获取 我这样写错了吗??大家帮忙看下 谢谢~!

解决方案 »

  1.   

    看你的 <form> 中 是否设置了 enctype="multipart/form-data"
      

  2.   

            //上传文件的集合   
            System.Web.HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;
            //共上传的文件个数   
            int iFile = files.Count;
    这样也是0 呜呜呜
      

  3.   

    1.add a    ENCTYPE="multipart/form-data"   in form tag
    2.have you use ajax,if true ,then drop it 
    good luck 
      

  4.   

    还有一个办法:
    $("#image_list").append("<input runat=server id=\"_ImageID_"+$(this).attr("fyVal")+"\" name=\"_ImageID_"+$(this).attr("fyVal")+"\" class=\"text_w3\" type=\"file\" />");