将private string fullFilePath = Server.MapPath(file_Path).ToString(); 
放到后台的方法中使用

解决方案 »

  1.   

    public partial class _Default : System.Web.UI.Page  

        private string file_Path = ConfigurationManager.AppSettings["FileUploadPath"].ToString();     private string fullFilePath = Server.MapPath(file_Path).ToString(); 

    改为public partial class _Default : System.Web.UI.Page  

        private static string file_Path ;
        private static string fullFilePath ;
        public _Default()
       {
         file_Path = ConfigurationManager.AppSettings["FileUploadPath"].ToString(); 
         fullFilePath = Server.MapPath(file_Path).ToString();
       }
    } 在构造函数中进行静态变量的初始化;
    或者public partial class _Default : System.Web.UI.Page  

        private string file_Path ;    private string fullFilePath ;
        
        protected void Page_Load(object sender, EventArgs e)
        {
            file_Path = ConfigurationManager.AppSettings["FileUploadPath"].ToString(); 
            fullFilePath = Server.MapPath(file_Path).ToString();
        }