Quiero manejar Error StatusCode en asp.net core.
Escribí esto en Inicio>Configurar
app.Use(async (context, next) => { await next(); if (context.Response.StatusCode == 404) { var page = HttpFailedTemplates.NotFoundPage(context.Request.Path, context.TraceIdentifier, DateTime.Now.ToString(), "نیل سافت", "https://localhost:44313/"); // in page I have -> <script src='https://localhost:44347/js/libraries/jquery.min.js'></script> in <body> tag context.Response.ContentType = "text/html"; var buffer = Encoding.UTF8.GetBytes(page); using (var stream = context.Response.Body) { await stream.WriteAsync(buffer, 0, buffer.Length); await stream.FlushAsync(); } await next(); } });Pero después de la respuesta de devolución, no tengo etiquetas de script.
Agregué mi etiqueta Script en la etiqueta Head. Ahora funciona.