<input id="filMyFile" type="file" runat="server">加上runat=server不知道会不会好点。要是传图象之类的话,最好在form中加这个:
<form id="Form1" method="post" runat="server" enctype="multipart/form-data">
参考:
http://www.codeproject.net/aspnet/fileupload.asp

解决方案 »

  1.   

    上面的方法可以正常运行还有一种方法, 是动态生成多个文件时的上传方法
    //上传文件的集合
    System.Web.HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;//共上传的文件个数
    int iFile = files.Count;
    if(iFile > 0)
    {
    HttpPostedFile file = files[0];
    string strKey = files.Keys[0].ToString();
    if(strKey == "file1")
    {
    //取得的是你要的那个域的文件
    //对file进行处理
    ...
    }