# Configuring ASP.NET and IIS for Larger Requests

> The session-less MVC DocumentViewer sends documents via POST, requiring three web.config changes for large files: IIS maxAllowedContentLength for byte limits, httpRuntime maxRequestLength for kilobyte caps, and MaxJsonDeserializerMembers for the JSON property count threshold.

- **Author:** Bjoern Meyer
- **Published:** 2019-12-20
- **Modified:** 2026-07-17
- **Description:** The session-less MVC DocumentViewer sends documents via POST, requiring three web.config changes for large files: IIS maxAllowedContentLength for byte limits, httpRuntime maxRequestLength for kilobyte caps, and MaxJsonDeserializerMembers for the JSON property count threshold.
- **2 min read** (293 words)
- **Tags:**
  - ASP.NET
  - Document Viewer
  - MVC
  - Release
- **Web URL:** https://www.textcontrol.com/blog/2019/12/20/documentviewer-configuring-aspnet-for-larger-requests/
- **LLMs URL:** https://www.textcontrol.com/blog/2019/12/20/documentviewer-configuring-aspnet-for-larger-requests/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2019/12/20/documentviewer-configuring-aspnet-for-larger-requests/llms-full.txt

---

The ASP.NET [MVC DocumentViewer](https://www.nuget.org/packages/TXTextControl.Web.DocumentViewer/) can be used to view all document types that are supported by TX Text Control including TX, DOC, DOCX, RTF and PDF.

![TX Text Control MVC DocumentViewer](https://s1-www.textcontrol.com/assets/dist/blog/2019/12/20/a/assets/documentviewer.webp "TX Text Control MVC DocumentViewer")

When loading documents using the JavaScript loadDocumentmethod or when loading from memory directly in the MVC view code, the document will be sent to the server in a POST request. For larger documents, it is required to increase the size of data that can be send to the server.

There are 3 areas in the *web.config* file that have to be adjusted to accept larger POST requests:

- IIS Request Filtering
- HttpRuntime maxRequestLength
- MaxJsonDeserializerMembers

### IIS Request Filtering

On IIS level, the *Request Filtering* module is used to limit the size of data accepted by IIS. Increase the *maxAllowedContentLength* value that specifies the size of the POST buffer given in bytes.

The default size is 30000000 bytes (28.6 MB). Max value is 4294967295 bytes (4 GB)

```
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
     <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="4294967295"  />
      </requestFiltering>
    </security>  
   </system.webServer>
</configuration>
```

### HttpRuntime maxRequestLength

ASP.NET has its own setting to limit the size of uploads and requests. Use the *maxRequestLength* of the *httpRuntime* element.

The default size is 4096 kilobytes (4 MB). Max value 2,147,483,647 kilobytes (~82 Terabyte). The following setting defines a max size of 500 megabytes.

```
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.web>
    <httpRuntime maxRequestLength="500000" executionTimeout="120" />
  </system.web>
</configuration>
```

Pay attention to the different units used by these settings. *Request Filtering* is in **bytes** and **HttpRuntime maxRequestLength** is given in kilobytes.

### MaxJsonDeserializerMembers

All data is send as JSON objects in the DocumentViewer client-server communication. The number of properties in a posted JSON object needs to be adjusted using the *aspnet:MaxJsonDeserializerMembers* application setting:

```
<configuration>
  <appSettings>
    <add key="aspnet:MaxJsonDeserializerMembers" value="10000" />
  </appSettings>
</configuration>
```

By adjusting the above settings in your *web.config*, all document sizes can be loaded from memory.

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [Updated MVC DocumentViewer: Session-less and Improved Image Quality](https://www.textcontrol.com/blog/2019/12/12/updated-mvc-documentviewer-session-less-and-improved-image-quality/llms.txt)
- [High-Performance Text Replacement in Large DOCX Files using C# .NET](https://www.textcontrol.com/blog/2025/07/30/high-performance-text-replacement-in-large-docx-files-using-csharp-dotnet/llms.txt)
- [Document Viewer 33.2.1 Released: New Event and Bug Fixes](https://www.textcontrol.com/blog/2025/07/30/document-viewer-33-2-1-released-new-event-and-bug-fixes/llms.txt)
- [Document Viewer: Long Polling Support for Loading Documents](https://www.textcontrol.com/blog/2024/04/25/document-viewer-long-polling-support-for-loading-documents/llms.txt)
- [TX Text Control React Packages Released](https://www.textcontrol.com/blog/2024/02/29/tx-text-control-react-packages-released/llms.txt)
- [Document Viewer 31.3.1 Released](https://www.textcontrol.com/blog/2023/07/14/document-viewer-3111-released/llms.txt)
- [Document Viewer 31.2.3 Released: PDF.js and Bug Fixes](https://www.textcontrol.com/blog/2023/05/08/document-viewer-3123-released-pdfjs-web-component-and-regular-expressions/llms.txt)
- [Document Viewer 31.2.2 Final Released: PDF.js, Web Component and Regular Expressions](https://www.textcontrol.com/blog/2023/03/29/document-viewer-3122-final-released-pdfjs-web-component-and-regular-expressions/llms.txt)
- [Use PDF.js to Render PDF Documents within the Document Viewer](https://www.textcontrol.com/blog/2023/03/18/use-pdfjs-to-render-pdf-documents-within-the-document-viewer/llms.txt)
- [Document Viewer 31.2.2 RC1 Released with New Features](https://www.textcontrol.com/blog/2023/03/17/document-viewer-3122-rc1-released-with-new-features/llms.txt)
- [Document Viewer Update: DocumentViewer 31.1.1 Released](https://www.textcontrol.com/blog/2022/12/20/document-viewer-update-documentviewer-3111-released/llms.txt)
- [Merging Signature Annotations into Documents](https://www.textcontrol.com/blog/2022/10/19/merging-signature-annotations-into-documents/llms.txt)
- [MVC NuGet Packages for X18 Published](https://www.textcontrol.com/blog/2020/03/17/mvc-nuget-packages-for-x18-published/llms.txt)
- [DocumentViewer: New Two Page View Mode](https://www.textcontrol.com/blog/2020/01/02/documentviewer-new-two-page-view-mode/llms.txt)
- [Using Multiple Electronic Signatures on a Document](https://www.textcontrol.com/blog/2019/10/23/using-multiple-electronic-signatures/llms.txt)
- [MVC DocumentViewer Update: Printing, Resources and Mobile-Friendly Document Signing](https://www.textcontrol.com/blog/2019/10/18/mvc-documentviewer-update-printing-resources-mobile/llms.txt)
- [MVC DocumentViewer: Loading Documents](https://www.textcontrol.com/blog/2018/07/03/mvc-documentviewer-loading-documents/llms.txt)
- [Using the ASP.NET MVC DocumentViewer JavaScript API](https://www.textcontrol.com/blog/2017/04/28/using-the-aspnet-mvc-documentviewer-javascript-api/llms.txt)
- [HTML5 Based MVC DocumentViewer Public Beta Program Launched](https://www.textcontrol.com/blog/2017/04/26/html5-based-mvc-documentviewer-public-beta-program-launched/llms.txt)
- [TX Text Control 34.0 SP4 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2026/05/20/tx-text-control-34-0-sp4-is-now-available/llms.txt)
- [TX Spell .NET 11.0 SP1 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2026/04/08/tx-spell-net-11-0-sp1-is-now-available/llms.txt)
- [TX Text Control 34.0 SP2 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2026/02/18/tx-text-control-34-0-sp2-is-now-available/llms.txt)
- [TX Text Control 34.0 SP1 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2025/12/03/tx-text-control-34-0-sp1-is-now-available/llms.txt)
- [Introducing TX Text Control 34.0: Your Next Leap in Document Processing](https://www.textcontrol.com/blog/2025/11/10/introducing-tx-text-control-34-0-your-next-leap-in-document-processing/llms.txt)
- [PDF/UA vs. PDF/A-3a: Which Format Should You Use for Your Business Application?](https://www.textcontrol.com/blog/2025/10/24/pdf-ua-vs-pdf-a-3a-which-format-should-you-use-for-your-business-application/llms.txt)
