What about ashx handlers?http://forums.asp.net/t/1197073.aspx/1?What+about+ashx+handlers+Sat, 22 Dec 2007 11:33:21 -050011970732072576http://forums.asp.net/p/1197073/2072576.aspx/1?What+about+ashx+handlers+What about ashx handlers? <p>In a previous project I used a handler to display images that were stored in a database. The url would look something like this: Thumbnail.ashx?id=1&amp;size=150</p> <p>Is this something you'd use a controller for as well? I could imagine the controller using the id to fetch the binary data, but I don't know if the controllor should call a view to actually render a bitmap to the response (including resizing) or if I should do all that in the controller's action as well. Any tips?</p> <p>Thanks!&nbsp;</p> 2007-12-21T13:45:12-05:002072608http://forums.asp.net/p/1197073/2072608.aspx/1?Re+What+about+ashx+handlers+Re: What about ashx handlers? <p>&nbsp;Something like that I would keep in the controller, I would probably have a model service to handle all the manipulation than just call the service and write the bytes to the output stream.<br> </p> <p>Thats the best part about MVC.&nbsp; The controller is in charge, not the view. </p> <p>You would now probably be able to give it an SEO friendly url to so it ends .jpg <br> </p> 2007-12-21T14:01:18-05:002072996http://forums.asp.net/p/1197073/2072996.aspx/1?Re+What+about+ashx+handlers+Re: What about ashx handlers? <p>That's clear, thanks for the tips!<br> </p> 2007-12-21T17:12:45-05:002073042http://forums.asp.net/p/1197073/2073042.aspx/1?Re+What+about+ashx+handlers+Re: What about ashx handlers? <p></p> <blockquote><span class="icon-blockquote"></span> <h4>abombss</h4> You would now probably be able to give it an SEO friendly url to so it ends .jpg </blockquote> &nbsp; <p></p> <p>How would you do that?</p> <p>&nbsp;</p> <p>Thanks</p> <p>Marco&nbsp;</p> 2007-12-21T17:31:26-05:002073120http://forums.asp.net/p/1197073/2073120.aspx/1?Re+What+about+ashx+handlers+Re: What about ashx handlers? <p>Try this and let me know if it works, haven't tested and interested myself.</p> <pre class="prettyprint">new Route( Url = &quot;gallery/thumbnails/[size]/[id].jpg&quot;, Defaults = new { Controller = &quot;Thumbnail&quot;, Action=&quot;Show&quot; } Validation = new { Size=&quot;75|150|300&quot;, Id=&quot;\d{1,10}&quot; } }</pre> 2007-12-21T18:28:52-05:002073761http://forums.asp.net/p/1197073/2073761.aspx/1?Re+What+about+ashx+handlers+Re: What about ashx handlers? <p>&nbsp;That's an excellent example, thank you.<br> </p> 2007-12-22T11:33:21-05:00