Blog

Convert any List to valid jqGrid Json Object.

By David EspinoJquery UI controls are actually very useful on many web projects and jqGrid is an excellent example. This is a really handy control that can help us to render our list of objects using Ajax calls. How to fill the jqGrid? The jqGrid needs a json object with a particular structure. This is an example of the json object used to fill a jqGrid. {"page":1,"total":100000,"records":1000000,"rows":[{"id":"1","cell":["1","VINET","1996/07/04","32.3800","Vins et alcools Chevalier"]}, {"id":"2","cell":["2","TOMSP",...

Dependency Injection in MVC3

By Carlos MartinezDependency Injection is a form of Inversion of control where the dependent objects are injected into a class, instead of creating an instance. The usual way to implement this pattern is using an object container and plain objects. Each container injects the entire requested objects based on a previous configuration. A new interface is available in MVC 3, called “IDependencyResolver”. This interface enabled service location by providing these 2 methods: ·         GetService(Type serviceType) ·         GetServices(Type serviceType) While in MVC 2 a custom ControllerFactory has to be created (and specified in the application class), in MVC 3 all it takes is to specify a...