-
Notifications
You must be signed in to change notification settings - Fork 46
Home
Welcome to the RequireJSDotNet wiki!
Writing modular JavaScript is the first step in bringing the front-end development closer to the server-side OOP, for a C# programmer, the Module Pattern applied to JavaScript means that you can emulate the .NET class behavior by having public/private members and methods. With RequireJS you can go even further, by declaring a module you can specify dependencies to other modules, the same way as you do in a .NET project when you add references to other .NET components.
Before a module is loaded by the browser, RequireJS will look for the dependencies required by that module to function, it will fetch asynchronously from the server all the other modules needed and then will let the browser execute your module code. This technique can be easily understood if you think about how .NET Framework uses the JIT compiler to link assemblies, in .NET, a referenced .dll gets loaded when the first method is trying to access anything from the referenced assembly, in JavaScript, RequireJS loads all the referenced modules and executes them in the right order before the main module is executed. Further more, RequireJS can optimize the page load by combining all dependencies into a single minified js file.
The RequireJS for .NET project smoothly integrates the RequireJS framework with ASP.NET MVC on the server side using xml configuration files, action filter attributes, a base controller for inheritance and helper classes. Below you’ll find a series of articles that explain in depth how you can configure, program and deploy web applications powered by RequireJS.
[Passing values between ASP.NET and JavaScript] (https://github.com/vtfuture/RequireJSDotNet/wiki/Passing-values-between-ASP.NET-and-JavaScript)