Enums with automatic drop-downs in MVC

If there is something I like about ASP.NET MVC, it’s the great deal of formulas that it offers us to increase our productivity. Virtually any code that we are tired of repeating over and over again can be encapsulated and reused using the extension points provided by the framework. Today we will look at a [...]

Continue Reading

Implementing CORS in ASP.NET Web API

Most of you are probably aware of the release of ASP.NET WebAPI for the next version of ASP.NET MVC. In fact, others like our tutor Jose M. Aguilar has already written some very interesting posts on the subject, which I highly recommend. In this post, I want to address an important aspect about creating a [...]

Continue Reading

DEVELOPERS’ FAILS #2: Using global variables

In my previous article I started this new series, dealing with those things all of us programmers do wrong. Last time I talked about writing code which is difficult to read. Today’s topic is: Developer’s mistake #2: Using global variables Developers who by now have some years of practice will probably remember the times of [...]

Continue Reading

Asking for one thing and getting another – Part II: Transferring execution

In the previous post of this series we have seen that the easiest way to transfer a user from one page to another is with a redirect on the client side, using Redirect or RedirectPermanent. However this involves two request-response sequences to the server, and the final page is displayed in the user’s address bar. [...]

Continue Reading
Azure

Windows Azure SQL Database Backup with SQL Server Management Studio

Recently, I had to create a backup procedure on my Windows Azure SQL Database. SQL Server Management Studio allows us to access our SQL Databases and provides the user interfaces for creating backup files. In this post, we will learn: how to create a copy of our Azure SQL Database how to save a logical [...]

Continue Reading

Asking for one thing and getting another – Part I: Redirect and RedirectPermanent

In ASP.NET there are many methods that we can use to ensure that when a user requests a page from the server they actually get the result of executing a different page or resource. Why would we want to do that? There are many reasons, and developers do it all the time to: Redirect users [...]

Continue Reading

DEVELOPERS’ FAILS – #1: Writing code that is difficult to maintain

This is the first article in a series that will deal with developer ‘FAILS’, in order to provide a few pointers on how to write better code. For this, we will go over some of the most common mistakes that all of us developers make. And these mistakes are not language or environment-specific, so this [...]

Continue Reading
Automatic documentation in WebAPI services

Routes in lower case in ASP.NET MVC 4 and 4.5

Surely you have noticed that when generating URLs to actions of an MVC application using helpers such as Url.Action() or Html.ActionLink(), they are generated using upper and lower case depending on what we have specified in the parameters of the calls: Helper URL generated @Url.Action(“index”, “home”) /home/index @Url.Action(“List”,”Products”, new{ Category=”PC” }) /Products/List?Category=PC @Url.Action(“VIEWALL”, “PRODUCTS”) /PRODUCTS/VIEWALL [...]

Continue Reading
Azure

Windows Azure Service Bus topics: A first encounter

The Service Bus is the infrastructure provided by Windows Azure for implementing messaging patterns. Click here for further information about messaging management on Windows Azure. I want to create a “notification server” using the cloud, and Service Bus seems to fit my requirements. This article describes the concepts of “Queues, Topics and Subscriptions”: These “brokered” [...]

Continue Reading

ASP.NET MVC 4: DisplayModes organized into folders

I recently addressed the topic of creating custom Display Modes in ASP.NET MVC 4, and we saw how to do it using the DefaultDisplayMode class provided by the framework, with which we could cover most of our frequent needs. Thus we saw how the following code was enough to register a new Display Mode called [...]

Continue Reading