Weblog Posts in April 2012

GZip/Deflate Compression in ASP.NET MVC
April 28, 2012 @ 4:00am

If you want to create ASP.NET MVC content that uses gzip or deflate compression you need to use some custom code. Here's an action filter that compresses content in your ASP.NET MVC applications.

Internet Explorer and Cookie Domains
April 25, 2012 @ 6:04am

Got tripped up today by another IE issue: Internet Explorer will not accept Cookies with local domains set for the Cookie Domain and fail silently.

Getting a 'base' Domain from a Domain
April 24, 2012 @ 9:17pm

I was surprised to see that there wasn't some way in .Net to retrieve the base domain name from a sub-domain. For example, I want www.west-wind.com, and store.west-wind.com to return me just the base url. Easy enough but there are a couple small issues to check for especially when dealing with string based domain names.

ASP.NET MVC Postbacks and HtmlHelper Controls ignoring Model Changes
April 20, 2012 @ 2:19am

Today I discovered an MVC behavior I hadn't noticed: For HTML helper controls MVC always uses POSTBACK values to display the control value rather than model values when the View is rendering in a POST back. In effect this means that MVC Views can't update the value of controls during a POST back using the standard HTML Helper Controls.

Wishful Thinking: Why can't HTML fix Script Attacks at the Source?
April 14, 2012 @ 5:49pm

I'm dealing with user HTML input in a Web application today and again I curse over the complexities involved in sanitizing this html. So today I started dreaming about a possible alternative...

Odd MVC 4 Beta Razor Designer Issue
April 14, 2012 @ 12:54pm

I have an odd designer issue with MVC 4 Razor pages which are causing errors in the environment.

Physical Directories vs. MVC View Paths
April 05, 2012 @ 2:38pm

Physical directories that map paths that are also mapped by ASP.NET MVC routes can cause some consternation, especially if you're not aware that there's pathing overlap between the two. This post is a story about an operator error episode of an accidental file move that took a while to trace down due physical path interference.

Creating a JSONP Formatter for ASP.NET Web API
April 02, 2012 @ 5:03pm

Web API doesn't include native JSONP support, but it's pretty easy to create a custom formatter that handles this task. Here's how to create a JsonpFormatter and hook it up as well as a short review of how JSONP works.