Q:

Difference between @section Scripts and the usual script tag used in ASP.Net WebForm

What is the difference between the following 2 Javascripts?  I can use the second form of Javascript in Razor engine MVC pages without any issues, so what is the benefit of using the first form?
MVC style
@section Scripts {
    function check()
   {
      //do some validation logic here
   }
}

WebForms style
<script type="text/javascript">
       function check()
       {
          //do some validation logic here
       }
</script>

A:

The @section Scripts doesn't produce any output in the page on its own, you need to render the section somewhere. When you use it, there is a RenderSection call somewhere, like this:
<script type="text/javascript">
@RenderSection('Scripts')
</script>

The fact that the section is named Scripts doesn't have any relevance, it's just a convention that is used for sections that contain scripts.

