There are multiple possibilities.
1) Without Master-Content Pages.
Either you can add your JavaScript code inside
head
tag of your Aspx page.
<head runat="server">
<title>Test</title>
<script type="text/javascript">
function Test() {
alert('Hi');
}
</script>
</head>
Or add new
.js
file in your Project, write your JavaScript code inside it and then reference it in your Aspx page.
<head runat="server">
<title>Test</title>
<script language="javascript" type="text/javascript" src="Scripts/MyTest.js"></script>
</head>
2) With Master-Content Pages.
Calling JavaScript from ASP.NET Master Page and Content Pages - Part I
Calling JavaScript from ASP.NET Master Page and Content Pages - Part II