Thursday, December 5, 2013

Html.RatingFor: Extending the MVC HtmlHelper

When working on a web application, I was in the need to add a rating for a product. That rating will be between 1 and 5 and will be always an int. So my model has a property like public int Rating {get;set;}. I decided to add 5 radio buttons, and each will hold the corresponding...

Friday, November 29, 2013

Public field not bound when posting to WebAPI (or a deep dive into WebAPI model binding)

When trying to create a sandbox project using WebAPI (on MVC4), I was struggling with a weird problem: My data wasn't being received in the server. I had the following jQuery call $.post("api/Values", {value1:1, value2:2}, function(result){ console.log(result); }) and the WebAPI...

Tuesday, November 19, 2013

Backing field for automatically implemented property [Field] must be fully assigned before control is returned to the caller

Working with structs in C# gives you a lot of flexibility on the way you design your applications, but since they are not reference types, they have some special features that we need to take in count. Recently I was working on a web application and I created a struct to hold a pair...

Monday, May 13, 2013

Install XAMPP on a Ubuntu 13.04 virtual machine running on Windows Azure

One of the many great things about Windows Azure is how easy you can create a virtual machine, no matter the OS of your preference. But for good or bad, your virtual machine will be fresh, so you need to work on setting up whatever you need to get to work. Recently I needed to set...

Wednesday, April 3, 2013

Localize your MVC app based on a subdomain

Having an application in multiple languages is now a requirement in many projects. In ASP.net, you can tell your application that the language that should be using corresponds to the one the browser is specifying. While this is a really nice feature in the ideal scenarios (since...

Tuesday, March 5, 2013

Runtime customizable model attributes in ASP.net MVC3

It can be because you want to implement I18N without the use of resources, or your model classes are outside of your MVC project, or any other reason you have that make you want not being tied to the inline (compile time) annotations on your model. Whatever is the case, you can...

Thursday, January 31, 2013

The importance of profiling your application

It is well known that the ORM can help a lot in software development. In fact, they solve many problems that as developers we had in the past, specially talking about Opening and Closing Connections. But as ORM frameworks are a powerful tool,they can also make a mess if they are...

 

Copyright @ 2013 A learning journey.