Tag Archives: ashx

URL Rewrite and Sitecore

The Microsoft URL Rewrite module is an ISS extension that allows you to rewrite one URL to another using regular expressions. The extension is like the Sitecore aliases on steroids, and is especially useful for mapping old dynamic URL’s to … Continue reading

Posted in .net, c#, General .NET, Sitecore 6, Sitecore 7 | Tagged , , , , | 1 Comment

Stream Sitecore media items to HttpResponse

Here is a small tip for you who is doing API’s based on Sitecore. How to get an item from the Sitecore Media Library and stream it to the HttpResponse of a page. This is an example of an .ashx … Continue reading

Posted in .net, c#, Sitecore 7 | Tagged , , , | 1 Comment

The .ashx extension – Writing your own HttpHandler

Have you noticed how Sitecore serves images using an .ashx extension? A .ashx file is a HttpHandler. A HttpHandler is kind of a lightweight aspx page, as the HttpHandler only deals with the HttpContext – for example there is no page … Continue reading

Posted in General .NET | Tagged , | 9 Comments

Media Library file names. Tired of guids?

Have you noticed that when uploading files to the media library, sometimes the resulting file name is a guid? If I upload an image, say Brian.jpg, I need to write ~/media/9B62BB56FD6040FAA56C6DB1D8A0BDE6.ashx in order to acces it from the front end. And … Continue reading


Posted in Sitecore 5 | Tagged , , | Leave a comment

Sitecore 5.3 and ImageURI

If you assign the path of a media item to a Image.ImageUrl in code behind it will not find the image unless you prefix the path with a /, see the example code below: If you do not make the … Continue reading

Posted in Sitecore 5 | Tagged , , | 1 Comment