Maximum request length exceeded exception on postback
A postback sends back the viewstate of every control - if you have a huge datagrid, then when the browser reposts that to the server, this is why you are getting the exception.
Your two options are:
- Set
EnableViewState="false"
on your GridView if you do not need the viewstate, so it's not so bloated and the postback is a reasonable size, Increase the maximum request size in
web.config
as shown below:<configuration> <system.web> <httpRuntime maxRequestLength="32768" /> </system.web></configuration>
Hope this helps