Today I spoke with a frontend developer at my work and he showed me some really nice tools frontend developers use nowadays for creating websites. As a backend developer I never looked further then Twitter Bootstrap and jQuery but frontend development is so much more I discovered today!
When you are building a website you will sooner or later want to build in some kind of Identification and Authorisation control to make sure not everyone can change your website or see sensitive information. In this tutorial I will show you how to build in simple Identification and Authorisation in your ASP.NET MVC website.
Ajax requests are only possible when the protocol, domain and port number are the same. But sometimes you want to do Ajax calls to a different domain for example when you are creating a shared service that people should be able to call using Ajax or when you are developing locally and you are testing on a remote server. There are multiple ways to get around this restriction for example by using CORS, an iFrame or JSONP. In my last project I got around the restriction using JSONP, so I will explain that here. See links for more information about solving it using CORS.
Recently I was working on a ASP.NET MVC application where users could add budgets. The budgets were saved as floats. The problem was that some users used a (.) as decimal and others a (,). It depends on which culture setting your application is running if ModelState.isValid is true or false in such case. The culture setting in which your application runs depends on the system on which it is running. This is not a desired behaviour. Its better to specify the culture in the application itself and force users to use a (.) or (,). To run an ASP.NET MVC application in a specific culture setting you can add the following code to your Global.asax file:
public class MvcApplication : System.Web.HttpApplication
protected void Application_AcquireRequestState(object sender, EventArgs e)
var culture = CultureInfo.CreateSpecificCulture("nl-NL");
Thread.CurrentThread.CurrentUICulture = culture;
Thread.CurrentThread.CurrentCulture = culture;
When I First heard about the Entity Framework I thought there was only one correct way of implementing it and that is using the Code First approach. Now I am not that sure anymore. In this article I will explain the various approaches and their advantages and disadvantages.
Have you ever heard about the term Inversion of Control (IoC) or dependency injection but you dont know exactly what it is or why you need it then continue reading. If you have never heard about it before and you are a developer then keep on reading also! Its a really cool way of programming (design pattern) and it can help you a lot in the future and its not that difficult 😉