0

I have an index.cshtml that includes a partial razor view called "_CustomPartial.cshtml". The view is rendered ok. I included 2 javascript files in my partial view that reference a div from my partial. This part isn't working. I think the scripts are not being loaded. Below is my code:

_CustomPartial.cshtml:

<div style="overflow: auto; width: 100%; height: 100%;">    
    <div id="gvplayer" style="width:50%;height:400px; float: left; border: thin solid black;">
    </div>
</div>

@section JavaScriptIncludes
{
    <script type="text/javascript" src='@Url.Content("~/js/PlaybackScript.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/js/PlaybackStateMachine.js")'></script>
}

PlaybackScript.js:

console.log('initializing Playback object');
const playbackObject = CustomWindow();
$('#gvplayer').val(playbackObject);

_Layout.cshtml:

<body>
...
@RenderSection("JavaScriptIncludes", required: false)
</body>

The scripts are not loaded because the I don't see the log in my console.

SoftwareDveloper
  • 559
  • 1
  • 5
  • 18

0 Answers0