The Power Struggle of FilterAttribute

I’ve been doing a lot of MVC2 work lately, and have been indescribably thrilled with how easy it is to write clean code with it (or at least what I consider clean code). Being able to Unit Test my Controllers and have separation from everything else is like magic. OK, maybe I am a little late to this ballgame. I discovered a very cool feature of MVC2, and that is the FilterAttribute. When reading documentation about how to ensure controller actions could only be run if the user was Authenticated, I naturally came to the AuthorizeAttribute. It was that simple! … Continue reading The Power Struggle of FilterAttribute

ASP.NET AJAX 4.0 Client Template Rendering

Recently I have been dabbling with the ASP.NET 4.0 Framework. There were two things that immediately got my interest: An actual new version of the CLR. More of come on that later… AJAX 4.0 Now, I didn’t mean to say I was pumped an excited about it, but a certain element caught my attention, and that is Client Rendering. This basically, allows you to bind simple HTML to JSON or a simple JavaScript array. The idea is interesting, but I wasn’t sure how well it’d play. To get started, I looked here: This is a brief overview of the … Continue reading ASP.NET AJAX 4.0 Client Template Rendering

Managing IIS Pipeline Mode for Backward Compatibility

Ever since the induction of IIS 7, there came a cool new feature for developers to leverage called Integrated Pipeline. This feature in a short explanation closely couples ASP.NET and IIS more closely. It allows allows writing of IIS Modules in managed code, how neat is that? This also slightly changes the behavior of ASP.NET, such as introducing new events on the HttpApplication (Global.asax) and the event cycle. A classic example is where in Integrated mode you cannot access the current request using HttpContext.Current.Request during theApplication_Start event, which makes sense. Now for obvious reasons this can break existing applications, and … Continue reading Managing IIS Pipeline Mode for Backward Compatibility

Text Encoding (Part-1)

I was recently on the ASP.NET Forums and a member was asking, “How can I figure out the encoding of text?” and that got me thinking. There should be a reasonable way to do this, right? It’s a useful thing to know. First, we need a little background on how text is encoded into bytes. Long ago, back when 64K of memory was a big deal, characters took up a single byte. A byte ranges from 0 – 255, which allows us to support a total of 256 characters. Seems like plenty, no? English has 26, 52 for both cases, … Continue reading Text Encoding (Part-1)

MVC Framework

The MVC framework is the new “hot” thing in the ASP.NET world for developers. As such, everyone has at least one blog entry about it. So, I think it’s time I jumped on that ship. Though, I wanted to voice a few concerns with the MVC Framework, or at least how people perceive it. The MVC design pattern is by no means new. It’s been around since around 1979, and .NET is certainly not the first framework that supports the MVC Pattern, and nor is Microsoft’s MVC Project the first for .NET. Spring is a very popular MVC solution for … Continue reading MVC Framework