1.先导包,Brettle.Web.NeatUpload.dll导进web层中,再添加到vs控件中。
2.把NeatUpload文件夹放到根目录下。
3.直接拉要用到的控件到页面上,在使用
1 <Upload:ProgressBar ID="pbProgressBar" runat='server' Height="60" Width="400" Inline="true"> 2 </Upload:ProgressBar>
时,最好加上高和宽,要不会变态的。
4.配置web.config文件
(1)在configSections节点里添加:
1 <sectionGroup name="system.web"> 2 3 <section name="neatUpload" type="Brettle.Web.NeatUpload.ConfigSectionHandler, Brettle.Web.NeatUpload" allowLocation="true" /> 4 5 </sectionGroup>
(2)在system.web节点里添加:
1 <!--useHttpModule="true" 设为true时才能看到上传状态,默认是False--> 2 <neatUpload useHttpModule="true" maxNormalRequestLength="40960" maxRequestLength="20971510" defaultProvider="FilesystemUploadStorageProvider"> 3 4 <providers> 5 6 <add name="FilesystemUploadStorageProvider" 7 8 type="Brettle.Web.NeatUpload.FilesystemUploadStorageProvider, Brettle.Web.NeatUpload" /> 9 10 </providers> 11 12 </neatUpload>
(3)在system.web节点里找httpModules,如果没有直接添加:
1 <httpModules> 2 3 <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" /> 4 5 6 </httpModules> 7 <!--useHttpModule="true" 要設true才能看到上傳狀態bar,預設是False-->
然后就可以用了。