Q:

Add scripts at the head of Aspx

I want to add some scripts at the head of a website, written in aspx. However, aspx pages do not have head part, but it is generated afterwards. how I can write something at the head of a website written in aspx?

A:

You will have a layout page that has a head part. In that render an optional section for your scripts.
In your layout file:
<head>
    ...
    @RenderSection("scripts", required: false)
</head>

And in your view in which you want to add scripts to the head part of the page do this:
@section scripts
{
   @Scripts.Render("~/YourScript.js")
}

