I you have a view that is using the _Layout.cshtml and you tell the view to Reference script libraries, is that redundant since you will be referencing the script libraries from the _Layout.cshtml or am I missing something here. In all of the MVC tutorials I have gone through from Microsoft, they always leave Reference Script Libraries checked.
Share
When you check “Reference Script Libraries” this just adds references to
jquery.validate.min.jsandjquery.validate.unobtrusive.min.jsyou would only need these javascript libraries on pages with forms as it validates what a user has entered.You generally wouldn’t reference these in the
_Layout.cshtmlas they are not needed on non-form pages and would be unnecessary HTTP request performed when loading the page.If however you do have a form on every page or most pages and think it is acceptable to make the HTTP request on pages without forms then you can reference them in the
_Layout.cshtmland simply not check the “Reference Script Libraries” when creating views.