Benjamin Tinker Team : Web Development Tags : Web Development Umbraco MVC

Learning MVC3 with Razor?

Benjamin Tinker Team : Web Development Tags : Web Development Umbraco MVC

When breaking into new code territory be it MVC3, Razor, Umbraco or the anticipated HTML5 there is one thing a developer always has to keep in mind. Get a second opinion before using sample code. As we move into MVC3 and Razor from .NET Web forms there are the usual teething problems of ‘how do I do this in the new language?’ To make the transition a bit smoother and less stressful you should always cross check your information.

A simple case of using AJAX for form postbacks, as there is not ASP:UpdatePanel in Razor, caused some pains in ‘how do I do that’. It would have been a 5 minute job in .NET Web forms but as we’re on a new language we have to find the new way of doing things. Reading tutorials on the official Microsoft MVC site did not prove any help. They go on and on about how it should just work when using ClientValidationEnabled and UnobtrusiveJavaScriptEnabled flags in the Web.Config. What they forgot to mention, which I found from cross checking with Stack Overflow was that the JQuery libraries used for this validation or no longer supported by the Microsoft versions. Epiphany realised. So, I changed by jQuery libraries to the new ones and presto it all works. Time to get a coffee.

I feel for all those other developers who go through the same process of discovery when learning a new language. It reminds me of when I originally made that move from ASP to .NET. There were teething problems then but through persistence and cross checking I was able to ensure my learning of .NET was concise and informed.