-1

I am using C#.net

I have webpage, this page has a list view of "Reports IDs"

The requested functionality is Report Text should be displayed in a div when a user click on a report id in the list box.

Report Text is HTML format ( quite long around 16,000,000 char)

When I click on Report ID in the list box

I get this error

enter image description here

I added

<system.webServer>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="1073741824" />
            </requestFiltering>
        </security>
</system.webServer>

but still getting same error!

How to fix that?

Dale K
  • 25,246
  • 15
  • 42
  • 71
asmgx
  • 7,328
  • 15
  • 82
  • 143
  • Does this answer your question? [Maximum request length exceeded.](https://stackoverflow.com/questions/3853767/maximum-request-length-exceeded) – GSerg Mar 28 '21 at 22:35
  • @GSerg yea that where i got my answer from – asmgx Mar 28 '21 at 23:19

2 Answers2

0

I found the answer

In system.web

<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />

And in system.webServer

<security>
    <requestFiltering>
        <requestLimits maxAllowedContentLength="1073741824" />
    </requestFiltering>
</security>
asmgx
  • 7,328
  • 15
  • 82
  • 143
0

This might help you!

<configuration>
  <system.web>
    <httpRuntime targetFramework="4.5.2" maxRequestLength="1048576"/>
  </system.web>
</configuration>

<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="1073741824" />
    </requestFiltering>
  </security>
</system.webServer>

Rules:

  • maxRequestLength (expressed in kb) value must match maxAllowedContentLength (expressed in bytes).
  • most of the time your system.web section may already contains an "httpRuntime". set your targetFramework to the version of your .net used.

Notes:

  • default value for maxRequestLength is 4096 (4mb). max value is 2,147,483,647
  • default value for maxAllowedContentLength is 30,000,000 (around 30mb). max value is 4,294,967,295
Salahuddin Ahmed
  • 4,854
  • 4
  • 14
  • 35