This post is a follow up to to 2 posts: Find/Replace on Render – an MVC alternative to Response Filters and Response.Flush and the crimes against Page Caching. In the first post I explored a way to parse special tags before rendering a page. I’m working on a CMS that accepts special tags inside content. Those tags are then replaced on render. For example, an author might place a tag like: 1: <CustomAmazonBestSellers Count=”5” />
to display the 5 best selling products on Amazon (we don’t support...
Problem I have a model that uses the State pattern. Some States allow read/write access to the Model’s properties and some are read-only. I wanted a good way to separate the logic for this from my Views; the View shouldn’t have to decide whether properties are displayed as TextBoxes or inside Divs. First Thought At first I was going to create a custom ViewEngine. That ViewEngine would be responsible for choosing the right View – that is, if the View was called “Edit” but the model was in a readonly state, it would change the View to...