Handling Formats Based On Url Extension

Posted by: youve been HAACKED, on 07 Jan 2009 | View original | Bookmarked: 0 time(s)

Rob pinged me today asking about how to respond to requests using different formats based on the extension in the URL. More specifically, hed like to respond with HTML if there is no file extension, but with JSON if the URL ended with .json etc... /home/index > HTML /home/index.json > JSON The first thing I wanted to tackle was writing a custom action invoker that would decide based on whats in the route data, how to format the response. This would allow the developer to simply return...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: ASP.NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1012 | Hits: 28

Similar Posts

  • Lower Case URLs and ASP.NET MVC more
  • Url.Action() and RouteValue Encoding more
  • Canonical Formats and Query Strings - IIS SEO Toolkit more
  • One Function to Rule All URLs more
  • Letting ASP.NET Handle Image File Extensions in IIS 6 more
  • Remove WWW. Prefix from URLs with URL Rewrite Module for IIS 7.0 more
  • Removing the .SVC Extension from WCF REST URLs more
  • ASP.NET MVC on IIS 6 Walkthrough more
  • URL Rewrite for IIS - SEO Friendly URLs love it ! more
  • SESSION NOTES: ASP.NET 4.0 Roadmap more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD