title: What is @section scripts and what it is used for
body: <p>I have downloaded a chat example from the Microsoft website. I have been following several tutorials but I have never seen the @section script{}  before I have done scripts without this block of c# code (@section script{}) and it seem to work fine but in this instance of the chat application using signal R when I do take the scripts outside the block it does not work.</p>
  
  <pre><code>@section scripts {
  &lt;!--Script references. --&gt;
  &lt;!--The jQuery library is required and is referenced by default in _Layout.cshtml. --&gt;
  &lt;!--Reference the SignalR library. --&gt;
  &lt;script src="~/Scripts/jquery.signalR-2.2.0.min.js"&gt;&lt;/script&gt;
  &lt;!--Reference the autogenerated SignalR hub script. --&gt;
  &lt;script src="~/signalr/hubs"&gt;&lt;/script&gt;
  &lt;!--SignalR script to update the chat page and send messages.--&gt;
  &lt;script&gt;
      $(function () {
          // Reference the auto-generated proxy for the hub.
          var chat = $.connection.chatHub;
          // Create a function that the hub can call back to display messages.
          chat.client.addNewMessageToPage = function (name, message) {
              // Add the message to the page.
              $('#discussion').append('&lt;li&gt;&lt;strong&gt;' + htmlEncode(name)
                  + '&lt;/strong&gt;: ' + htmlEncode(message) + '&lt;/li&gt;');
          };
          // Get the user name and store it to prepend to messages.
          $('#displayname').val(prompt('Enter your name:', ''));
          // Set initial focus to message input box.
          $('#message').focus();
          // Start the connection.
          $.connection.hub.start().done(function () {
              $('#sendmessage').click(function () {
                  // Call the Send method on the hub.
                  chat.server.send($('#displayname').val(), $('#message').val());
                  // Clear text box and reset focus for next comment.
                  $('#message').val('').focus();
              });
          });
      });
      // This optional function html-encodes messages for display in the page.
      function htmlEncode(value) {
          var encodedValue = $('&lt;div /&gt;').text(value).html();
          return encodedValue;
      }
  &lt;/script&gt;
  }
  </code></pre>