Application able to record error in OnError, but we are not able to do any redirect or so to show something meaningfull to user. Any ideas? I know that we can set maxRequestLength in web.config, but anyway user can exceed this limit and some normal error need to be displayed.
As you say you can setup maxRequestLength in your web.config (overriding the default 4MB of your machine.config) and if this limits is exceeded you usually get a HTTP 401.1 error.
In order to handle a generic HTTP error at application level you can setup a CustomError section in your web.config within the system.web section:
<system.web>
<customErrors mode=On defaultRedirect=yourCustomErrorPage.aspx />
</system.web>
Everytime the error is showed the user will be redirected to your custom error page.
If you want a specialized page for each error you can do something like:
<system.web>
<customErrors mode="On" defaultRedirect="yourCustomErrorPage.aspx">
<error statusCode="404" redirect="PageNotFound.aspx" />
</customErrors>
</system.web>
And so on.
Alternatively you could edit the CustomErrors tab of your virtual directory properties from IIS to point to your error handling pages of choice.
The above doesn't seem to work for 401.x errors - this code-project article explains a workaround for a what seems to be a very similar problem: Redirecting to custom 401 page