I have a view that should be able to show large string values (~20k chars).
In the past this value was rendered as a textarea value in a razor *.cshtml page. But when I displayed the webpage in firefox, the browser was not loading the page. (Don't have got further error description here)
I decided not to render the textarea value in the *.cshtml page anymore. Therefore I've added a script that loads the data via $.get() when the user clicks a button.
But I'm still unable to deal with the large values..!? Why is this? The large value is only treated on the server side - no transmission to the client! Or am I wrong?
I have turned now the log level (in appsettings.Development.json) to debug.
Now I get the following error:
Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2ConnectionErrorException: HTTP/2 connection error (PROTOCOL_ERROR): Request headers too long.
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.OnHeaderCore(Nullable`1 index, Boolean indexedValue, ReadOnlySpan`1 name, ReadOnlySpan`1 value)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.OnStaticIndexedHeader(Int32 index, ReadOnlySpan`1 value)
at System.Net.Http.HPack.HPackDecoder.ProcessHeaderValue(ReadOnlySpan`1 data, IHttpHeadersHandler handler)
at System.Net.Http.HPack.HPackDecoder.ParseHeaderValue(ReadOnlySpan`1 data, Int32& currentIndex, IHttpHeadersHandler handler)
at System.Net.Http.HPack.HPackDecoder.DecodeInternal(ReadOnlySpan`1 data, IHttpHeadersHandler handler)
at System.Net.Http.HPack.HPackDecoder.Decode(ReadOnlySequence`1& data, Boolean endHeaders, IHttpHeadersHandler handler)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.DecodeHeadersAsync(Boolean endHeaders, ReadOnlySequence`1& payload)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ProcessContinuationFrameAsync(ReadOnlySequence`1& payload)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ProcessFrameAsync[TContext](IHttpApplication`1 application, ReadOnlySequence`1& payload)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ProcessRequestsAsync[TContext](IHttpApplication`1 application)
CodePudding user response:
I'm using now HttpContext.Session instead of TempData in my controller. That's it..
