Tuesday, January 31, 2012

How to check if column existed by a simple way in MS SQL?

                  IF COL_LENGTH('TableName','ColumnName') IS NULL

                  BEGIN

                        exec sp_executesql @SQLStatement

                  END

CAPTCHA for Asp.Net MVC

http://www.stefanprodan.eu/2012/01/user-friendly-captcha-for-asp-net-mvc/

AttributeRouting, a ASP.NET MVC open source project

https://github.com/mccalltd/AttributeRouting/wiki/2.-Usage

Multiple Routes Mapped to a Single Action

You can specify multiple GET routes that map to a single action simply by adding more than one route attribute. This can be handy when supporting legacy urls. To specify the order of these routes, use the Order parameter. This is important because the first route will be used to generate outbound URLs.
  [GET("", Order = 1)]
  [GET("Posts", Order = 2)]
  [GET("Posts/Index", Order = 3)]
  public void Index()
  {
      return View();
  }