ASP.NET上传大于4M的文件的相关设置
步骤1:
修改win2003上传限制,找到windows\system32\inserv\metabase.xml文件
将其中的 aspmaxrequestentityallowed= 的值改为1073741824 (1G)
注意修改前要停止IIS等服务。
步骤2:
如果你装的是net1.1,请找到windows\...\v1.1.4322\config\machina.config文件,将execution timeout改为36000
将maxrequestlenth 值设为 1048576 (1G)
如果你装的是net2.0,请找到windows\...\web.config文件,在</system.web></configuretion>这一行的上方插入一行,
<httpruntime maxrequestlenth="1048576" executiontimeout="3600"/>
相关文档:
当新创建一个asp.net mvc应用程序,会自动产生一个路由配置。
Global.asax.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace mvcApp
{
// Note: For instructions on enabling IIS6 or IIS7 classic m ......
数据处理成功马上跳转到另外一个页面!
你的后台处理页面,也就是数据接收页面,执行完相关的操作后,使用下面的语句:
response.write("<script>alert('数据提交成功******');window.location.href='你想要转向的页面的地址';</script>")
这样随便他返回后怎么刷新,显示的始终是“数据提交成功 ......
asp.net允许上传的文件的最大为4M
如果想要传更大的需要更改web.config文件
<system.web>
<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />
</ststem.web> ......
web.config
<customErrors mode="On" defaultRedirect="ApplicationErroy.aspx" >
<error statusCode="403" redirect="403.htm"/>
<error statusCode="404" redirect="404.htm"/>
<error statusCode= ......