编译器错误消息: CS0117: “System.Web.UI.WebControls.FileUpload”并不包含“filename”的定义
源错误:
行 25: file1 = (FileUpload)DetailsView1.FindControl("fileupload1");
行 26: string filePath;
行 27: filePath = Server.MapPath("./productimage/" + file1.filename);
行 28: file1.SaveAs(filePath);
行 29: productadd1.inserparameters["fid_photo"].defaultvalue = file1.FileName;
源文件: d:\index\admin\productadd.aspx.cs 行: 27
显示详细的编译器输出:
D:\index\Bin> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Design\2.0.0.0__b03f5f7f11d50a3a\System.Design.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\assembly\dl3\12e5f8e8\0020d7cc_0c23c901\AspNetPager.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\assembly\dl3\196d8c2e\00b5c72e_2388c501\CuteEditor.DLL" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\App_Web_nehptgxf.dll" /debug- /optimize+ /w:4 /nowarn:1659;1699;1701 "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\App_Web_nehptgxf.1.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\App_Web_nehptgxf.3.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\App_Web_nehptgxf.4.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\App_Web_nehptgxf.6.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\App_Web_nehptgxf.0.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\App_Web_nehptgxf.2.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\App_Web_nehptgxf.5.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\App_Web_nehptgxf.7.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\index\ce6010fc\6fbdb80b\App_Web_nehptgxf.8.cs"
Microsoft (R) Visual C# 2005 编译器 版本 8.00.50727.1433
用于 Microsoft (R) Windows (R) 2005 Framework 版本 2.0.50727
版权所有 (C) Microsoft Corporation 2001-2005。保留所有权利。
d:\index\admin\productadd.aspx.cs(27,61): error CS0117: “System.Web.UI.WebControls.FileUpload”并不包含“filename”的定义
d:\index\admin\productadd.aspx.cs(29,21): error CS0117: “System.Web.UI.WebControls.AccessDataSource”并不包含“inserparameters”的定义
5 个解决方案
#1
filePath = Server.MapPath("./productimage/" +file1.PostedFile.FileName;
AccessDataSource没有inserparameters属性
AccessDataSource没有inserparameters属性
#2
inserparameters为insertparameters,少t
#3
不看了。。。头有点晕.....脚有点软
#4
好了,现在两个都解决了,“System.Web.UI.WebControls.FileUpload”并不包含“filename”的定义 中filename要写成FileName,F、N要大写!
#5
dddddddddddddd
#1
filePath = Server.MapPath("./productimage/" +file1.PostedFile.FileName;
AccessDataSource没有inserparameters属性
AccessDataSource没有inserparameters属性
#2
inserparameters为insertparameters,少t
#3
不看了。。。头有点晕.....脚有点软
#4
好了,现在两个都解决了,“System.Web.UI.WebControls.FileUpload”并不包含“filename”的定义 中filename要写成FileName,F、N要大写!
#5
dddddddddddddd