Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

web.config location element settings

I have a question on a sample of location element inside web.config:

    <configuration>
      <location path="UploadPage.aspx">
        <system.web>
          <httpRuntime maxRequestLength="128"/>
        </system.web>
      </location>
    </configuration>

The UploadPage.aspx refer to www.mysite.com/UploadPage.aspx or any file that called UploadPage.aspx inside my site? Can I write path="~/UploadTool/UploadPage.aspx" ? What if I want that this rule will be refer to any file that named UploadPage.aspx

like image 355
Nir Avatar asked Apr 30 '11 20:04

Nir


People also ask

Where do I put the location in Web config?

Use the location element in the Web.web> element and other configuration elements exactly as you use them in the Web. config file. The path attribute of the <location> element specifies the virtual directory or the file name where the location configuration items apply.

Where is IIS Web config located?

The configuration files for IIS 7 and later are located in your %WinDir%\System32\Inetsrv\Config folder, and the primary configuration files are: ApplicationHost.config - This configuration file stores the settings for all your Web sites and applications.

Where is the Web config file located in MVC?

config file is located in the %SystemRoot%\Microsoft.NET\Framework\%VersionNumber%\CONFIG\ folder. The default settings that are contained in the Machine.


1 Answers

Well, "/path" doesnt work you need to put ~/ at the beginning also /* at the end also works

here is an example

    <location path="~/upload-cs/Upload.aspx">
       <system.web>
          <httpRuntime maxRequestLength="5378" executionTimeout="300" />
       </system.web>
    </location>
like image 181
Nir Avatar answered Oct 15 '22 06:10

Nir