MVC Service Based Web Applications - Part III - Anchor Navigation and Exception Handling

In the last phase we demonstrated a simple, yet cumbersome method for loading static HTML views. For this phase of the project we will be looking at a less explicit method for view loading using anchors which will support the back and forward history navigation in the user's browser and in addition will allow bookmarks to function normally.

The first hurdle in this process will be detecting when there has been an anchor change. While some browsers have an event that can be hooked into legacy support will require the script use a polling method as a fallback. Writing a client side script to do this certainly isn't an insurmountable task but personally I use a script written by Ben Alman which he calls jquery-hashchange-plugin...

MVC Service Based Web Applications - Part II - Script Level Caching

Last week we set up a very basic web service API using ASP.Net MVC and demonstrated some simple HTML templating techniques. Today we'll be concentrating on the client side of things by implementing HTML views and script level caching.

What is Script Level Caching?

Simply put, script level caching is a method for storing static web page resources using javascript. While this certainly isn't a replacement for typical caching strategies it gives you, the developer, an added layer of cache control which can save you some headaches and your server some CPU cycles. For this tutorial we'll be using jQuery's data() method to store information but this approach could be used with any javascript framework...

MVC Service Based Web Applications - Part I - Introduction

As any developer knows, there's a delicate balance between having a do-it-yourself attitude and finding a library to solve every concrete problem you run into. Too much ambition will leave you wrestling with bugs relating to concepts you aren't well versed in and too much reliance on third party tools can code you into a corner. Speaking from experience, neither is a pleasant situation to be in. With the advent of service based web applications a variety of frameworks and concepts have sprung up with the intention of making developers lives easier. While I could describe in detail what I don't like about WCF, SOAP and ReST I'd rather simply demonstrate my own personal approach that utilizes the strengths of each without sacrificing flexibility. For this project you'll need to use ASP.Net MVC. Personally I'll be using version 3 but there shouldn't be any problems if you use version 4 or later. As this tutorial moves forward I may upgrade if there's a particular feature I want to take advantage of...