This might initially sound like a very bad idea, because it undermines one of the fundamental reasons for using SSL in the first place. But it’s suprising how often I come across situations where this comes in very handy, especially during development and testing when v...
OK, so you made the assumption that Microsofts Sharepoint team would have provided a simple way to access something as common (and not to mention extremely useful!) as site usage statistics. Which pages and resources are accessed at what time for how long how often the ...
In the previous posts i wrote about web applications communicating with the backend through a JSON REST API. I mentioned that I like to design specific REST methods for the given Views. That means we have to do some mapping from the objects given by the backend to the v...
As Webstep guru Thor Halvor explained in the this excellent blogpost – there are security restrictions to prevent/limit cross domain access of XMLHttpRequest’s – the cornerstone of AJAX. Flash and silverlight has the same restrictions – and solves this by using c...
When consuming a JSON REST API using AJAX the message is send as a XMLHttpRequest. Due to security reasons this is not allowed cross domain. Instead of returning the data as core JSON, JSONP is often used. The data will then not be parsed by the JSON parser but evaluate...
Creating a ASP.NET MVC 3 REST API returning JSON data is actually really simple. If you have a MVC 3 Visual Studio project template and you add a Controller the default HomeController will be added: 1: public class HomeController : Controller 2: { 3: public ActionResult...
This is my first blogpost and I thought I should start writing about the web application architecture i normally choose these days, –if I am allowed by the client to refactor or start from scratch. Hopefully more blogposts will come out of this. The first thing I do is ...
When you create a new ASP.NET MVC 3 Project in Visual studio, your script folder will by default contain among others: jquery-1.5.1.min.js jquery.validate.min.js (which is version 1.8.0) One of the first things you might want to do is update the jquery version to the la...
A Visual Studio feature worth checking out is the conditional breakpoint. In short, it allows you to set specific conditions that have to be met for a breakpoint to freeze execution. You have the choice between several types of conditions, like the value of a variable o...
From the world of databases we are familier with the term "atomic operation" : If not all operations succeed, don’t do any of them. An example is a banking system, where you move funds between accounts. If you deduct an amount from account #1 in operation 1, you...
While using data annotations with localization in your MVC model, you may end up with some untidy looking code like in this example, where all we do is adding display information and validation: 1: public class Character { 2: [Display(Name="Character_FirstNam...
LINQ is brilliant, and if you know how (and not to mention where, when and on what) to use it it will really improve the readability of your code and save you a hell of a lot of time. One thing that is missing though, is a direct implementation of the “in” statement, kn...