I found myself having to create a completely REST-enabled API for an in-house solution, so what better way to do this in .NET than leveraging ASP.NET Web API?
While Web API makes mostly everything about the process simple and easy, considering that this is going to be a full-fledged REST API, I had to consider allowing cross-domain requests to the API, which normally meant that I had to enable cross-origin resource sharing (CORS) on it.
I found a nice handful of good resources for ASP.NET Web API CORS support, but I found Carlos Figueira’s take on it the most helpful, so I went ahead and adapted his code into my own small AOP library for use with future projects.
Using the library should be as easy as just adding
[CorsEnabled] on your API actions and/or controllers. It provides a bit of additional functionality if you need it (like specifying allowed domains if you want).
Feel free to get the code here. I wholeheartedly welcome comments on it, and if you find that you want to fork it, be my guest.
The Google Chrome Frame is not new. It’s an IE plugin that acts as an additional rendering engine that delivers more or less the same features, offerings, and HTML5 + CSS3 goodness as the standard Google Chrome. Long story short, it’s a Google Chrome running inside your Internet Explorer. The ultimate problem was that it needed to be installed by a user with administrative rights.
And then the “non-admin” Chrome Frame came around. It’s a Chrome Frame that can be installed by any user on a client computer. Now, there’s virtually no reason anymore not to install it if you’re stuck on a legacy Internet Explorer for some reason.
Getting users to install Chrome Frame
Now, in order to be able to deliver all the cutting-edge HTML 5 rainbow goodness for your clients, you just have to make sure that install the Google Chrome Frame. How to do that?
Just include the following inside your markup, preferably right before the closing