ASP.NET页面特定配置

Tam*_*ege 4 asp.net configuration web-config

有没有办法让web.config文件的某些部分仅适用于单个文件(或目录,或一组文件等)

基本上我想将以下内容仅应用于应用程序中的单个页面,其余应使用默认设置:(它将上传大小限制为32M)

<system.web>
  <httpRuntime maxRequestLength="32768" executionTimeout="360"/>
</system.web>
Run Code Online (Sandbox Code Playgroud)

关键是我只希望该特定页面接受大文件.

Edu*_*añó 13

您可以使用:

  <location path="UploadPage.aspx">
    <system.web>
      <httpRuntime maxRequestLength="33554432" executionTimeout="360" />
    </system.web>
  </location>
Run Code Online (Sandbox Code Playgroud)

更多信息在这里.