I have a page that takes a long time to load.
The reason is the js script code.
I set it to load asynchronously but it doesn't help.
Is there a way to do this? (In the script, I also refer to the Model from view.)
PageView:
@section Scripts{
<script>
//Lots of code with functions and references to DOM and AJAX
</script>
}
_Layout:
@if (IsSectionDefined("Scripts"))
{
@await RenderSectionAsync("Scripts", true)
}
The server returns a timeout error (works locally without any problem)