Is it better for performance to reference 4 js files on Microsoft CDN Example :
JQuery,
JQueryUI,
JQuery Validation,
Knockout.js
or have it all in one Bundle ?
Related
I want to build responsive SPA web application. I followed old paradigms before and the way it is supposed to be done nowadays is not very familiar to me, so sorry if my question seems unadequate.
Now I'm trying to understand the motivation behind this MVC 5 SPA template: why would I need to use MVC and Web API in one application?
My app will not act as a service. I can simply return JSON from my action methods. If in my case it is absolutely not neccessary, what factors could change the situation in favor of using both WebAPI and MVC at the same time?
You don't have to but it is useful.
I'm usually using MVC for
generating initial html file for my SPA through index.cshtml
(bundles + some customization of initial html code)
generating dynamic JavaScript code (usually for something like configuration angular modules)
Web API or OData kicks in aferwards providing endpoints for your favourite SPA framework (angular / knockout etc.) returning json or even xml if you need.
Is it possible to create a .js.map file for javascript bundles on ASP.NET MVC?
I'm not familiar with ASP.NET MVC 3 (and more general with the ASP.NET MVC). I can not find any information whether it is possible to use my ScriptControl in ASP.NET MVC 3 project. The ScriptControl was implemented for my previous project in ASP.NET WebForms?
It's more common to use jquery.unobtrusive-ajax.js intead of ScriptManager scripts to use ajax and it's more powerfull to use bundle (only for Mvc4) instead of ScriptManager to manage script links for different configurations and also to minify combine, control caching etc
Yes you can use it. Instead of creating a new page in MVC 3 using Razor, use asp.net web pages for your view.
Although its not recommended. Do it, if you are too desperate.
I am planning to use MS Ajax Minifier with Asp.Net MVC 2.0 for handling the Js and Css files. Does anyone has experience with MS Ajax Minifier? I have following questions regarding this.
Is it the best way to use JS/CSS files in Asp.Net MVC or is there a better way. E.g. YUI Compressor, Telerik Extension for MVC?
As I understand we can use this to convert SomeFile.js to SomeFile.min.js at the build time. However In my mvc Views I still have the Script reference pointing to SomeFile.js. How does the browser will pick the SomeFile.min.js file?
It's one possibility to use. The integration when building is a nice asset and it has hypercrunching.
You must use the SomeFile.min.js in your script reference. But in Visual Studio you can have an uncompressed file with this name SomeFile-vsdoc.js for intellisense coding (in which you can also use xml comments which will be picked up by VS.
Another approach would be to use SquishIt.
Grz, Kris.
As far as I know, ASP.NET MVC leverages a lot of the features of ASP.NET Web Forms, one of these services is how to get the Html response from the template .aspx file (the view). Can asp.net mvc leverages any other platform to generate html over template files (something like PHP for example)?
EDIT: There is NO use case for this, just curiosity!
Yes, it can! The aspx model is just one of the view template mechanisms. There are others - you can even write your own. The key here is IViewEngine, with WebFormViewEngine being the aspx/ascx provider. ASP.NET MVC In Action covers some of this in chapter 6 "Customizing & Extending the ASP.NET MVC Framework".
you can use other ViewEngines
Spark
NHaml