1
Awaaz

Goodbye Http Handler, Hello FileResult

published 177 days, 7 hours, 51 minutes ago posted by amit_it7amit_it7 177 days, 18 hours, 36 minutes ago
Wednesday, March 10, 2010 4:41:10 PM GMT Wednesday, March 10, 2010 5:55:35 AM GMT
If you have been developing applications in ASP.NET MVC then you are probably familiar with the ActionResult class. The ActionResult is the most common type of object returned from an action. When building MVC apps, most of time you will use the ActionResult class. Last week while I was working on my open source project WeBlog, I built an HTTP Handler to serve up images. I started using an HTTP Handler for images because I needed a mechanism to prevent bandwidth leeching. The only bad thing about using an HTTP handler for images is that you end up with some pretty ugly URLS. By using a FileResult object with MVC you not only get a pretty URL but you also get a lot of flexibility on where you want your images to reside. You can store images anywhere you want and the URL will never need to change!
category: Technology | clicked: 0 | | source: www.codecapers.com | show counter code
tags: ASPNET, Http Handler, MVC

No comments yet, be the first one to post comment.

To post your comment please login or signup