我有一個應該能夠顯示大字串值(~20k 個字符)的視圖。
在過去,此值在 razor *.cshtml 頁面中呈現為 textarea 值。但是當我在 Firefox 中顯示網頁時,瀏覽器沒有加載頁面。(這里沒有進一步的錯誤描述)
我決定不再在 *.cshtml 頁面中呈現 textarea 值。因此,我添加了一個腳本,該腳本$.get()在用戶單擊按鈕時加載資料。
但我仍然無法處理大值..!?為什么是這樣?大值僅在服務器端處理 - 不傳輸到客戶端!還是我錯了?
我現在已將日志級別(在appsettings.Development.json中)轉為debug。
現在我收到以下錯誤:
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)
uj5u.com熱心網友回復:
我現在正在使用HttpContext.Session而不是TempData在我的控制器中使用。而已..
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/415413.html
標籤:
