I have 2 solutions in ASP.Net MVC. In both solutions I use jQuery (library included in main layout) But in latter solution jQuery didnt work in a view. So I used the @section Scripts { ... } for my jQuery in the View and it worked. My question is : Why in one solution jQuery worked well without @section Scripts and why the other solution needed to put my jQuery inside @section Scripts { ... } in order to work.
Both Views in the solutions have the libraries included in main layout (by default by Visual Studio)
Code I used:
This isi the test code I used
$(document).ready(function () {
$('#btnTest').click(function () {
$('#txtTest').val('Hey');
});
});