Blog

About Feedback & Tunnels (SDLC)

By Daniel Ramirez.   An important thing through the Software Development Cycle is the feedback a developer gets during or after iteration. He/she gets all kinds of it, from internal things such as code, to all the way up to what’s shown to the end users.   Feedback is important In any kind of work, I believe we should always look for some kind of feedback. Feedback does not necessarily means you have done things the wrong way, it can help you see how other people see your work, and lets you know if they understood correctly the idea behind it.   Feedback lets you know if things can be improved, motivates you to continue your work. If you get an email saying "Amazing work!"...

Powerful Javascript

By Guillermo Cedillo   C# is becoming more like a functional language in every release; by the other side Javascript is a functional language that was treated as a misunderstood-object-oriented-script language ¬_¬. I hope in the next years these two languages become so closer that they share the same basic principles of the functional languages.    Right now I'm looking closer to two technologies that I think they are going to be something extraordinary: RX and LINQ.   LINQ is already a powerful extension to C#, but also there's an extension for Javascript. LINQ gives you a lot of freedom in data manipulation, together with jQuery gives you flexibility and lightness in reports o...

Using the LINQ Aggregate fuction to create a CSV string from an IEnumerable.

By Osvaldo Orozco   This is the basic code that you can find when someone converts from an IEnumerable to a CSV string. This will be our starting point.   StringBuilder strBuild = new StringBuilder(1024); foreach (var item in myList) {       strBuild.AppendFormat("{0},", item.Key); } if (strBuild.Length > 0)       strBuild = strBuild.Remove(result.Length - 1, 1); string result = strBuild.ToString();   Now, we are going to use the “Aggregate” LINQ  function to create the CSV string.   First we need to add the namespace. using System.Linq;   The Aggregate function has several overloaded methods. The first method:                 TSource Aggregate<TSo...

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",...

How to create a custom InfoBox for Ajax Bing Maps 7.0

By David Espino Some of our Web applications often require displaying a geographic data, so Bing Maps is a good option to display this information. This version of Bing maps support customizations for different sections of the map, like the pushpins and infoboxes. This document will describe the process to change a pushpin infobox from this To something like this: First you need to create a js file to extend the pushpin infobox. It should have to have a custom container div and override the MouseOver and MouseLeave events so this div is shown or hidden. Also we need to implement a mechanism to avoid hiding the infobox if the mouse pointer is over it. And finally, just in case ...

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...

MVC 3 and Model Binding

By Carlos MartinezThe System.Web.Mvc namespace contains a class named DefaultModelBinder, the application object in MVC uses an instance of this class in order to binding all the values inside a post to a given model so it can be passed to an action. For normal scenarios no code is needed for these purposes.   When needed, a custom binder can be used in order to implement complex binding logic to a specific action or type. This new custom binder should implement the IModelBinder interface; this binder could be specified in the parameter definition of the post action for example:   [HttpPost] public ActionResult Index([ModelBinder(typeof(CustomModelBinder))] CustomModel model)   I...

How to implement custom validation logic using attributes in MVC3

By Carlos Martinez A common (and very recommended) practice when working with model validation in MVC3 is to decorate the model that will be sent to the view with validation attributes.  In order to do this MVC3 has several validation attributes ready to use for this scenarios such as: ·         DataTypeAttribute ·         RangeAttribute ·         RegularExpressionAttribute ·         RequiredAttribute An easy way to implement custom validation is to create attributes that inherits the ValidationAttribute  class and add logic to the IsValid Method. Adding code in this point will add server validations to the model (once the values are filled in the model throu a ModelBinder this vali...

How to add Conditional Comments on SharePoint 2010

By Omar L. Usually when we work on the .Net FronEnd, we just add this comment in our html. <!--[if IE 7]>         <link rel="stylesheet" type="text/css" href="sieena-ie7.css"/> <![endif]-->     This does not work in MOSS 2010.Solution.We need to implement a CSS Registration (SharePoint Control) with a conditional expression in our Master Page.This is the correct syntax. <SharePoint:CSSRegistration Name="sieena-ie7.css" ConditionalExpression=" IE 7" runat="server" /> When the page is rendered, it is going to generate the following conditional comment. <!--[if IE 7]...

How To Configure And Structure an ASP.NET Project ready for HTML5

By Guillermo Cedillo  Create new Project The master page contains concepts from boilerplate. Boilerplate is an excellent template which groups the best recommendations for webpage performance (it helps you a lot to obtain an A-grade with Yslow or Google PageSpeed). For our project I just add some features from boilerplate. I like to keep it simple but feel free to review it and implement the best concepts for your project. Those basic concepts are: •           Add styles on the top and scripts on the bottom. •           Add ie6/ie7/ie8... class in the html tag to allow ie fixes for css. •           Add metatags for compatibility and descriptions. •           Add modernizr for a...
 Next >>