Call the script from a view

Call the script from a view

  1. In the Solution Explorer, open Views Home Index.cshtml.

    Open Index.cshtml

  2. Change the code to be the following:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    @{
      ViewBag.Title = "Home Page";
    }
    <script src="~/Scripts/App/app.js"></script>
    <div id="message"></div>
    <div>
      Compiler: <input id="compiler" value="TypeScript" onkeyup="document.getElementById('message').innerText = sayHello()" /><br />
      Framework: <input id="framework" value="ASP.NET" onkeyup="document.getElementById('message').innerText = sayHello()" />
    </div>
doc_TypeScript
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.