Skip to main content

Posts

Showing posts from June, 2010

Display Images from SQL Server in ASP.NET Page with Generic Handler

In order to display an image stored in SQL Server on the Web Form, we need the concept of Generic Handler in ASP.NET. A Generic Handler is just any other web form that is added in the current form. A generic handler is responsible for fulfilling requests from a browser. A handler is a class that implements IHttpHandler interface. Normally the generic handler is having an extension of “Handler.ashx”. In my previous post, I discussed about the storing of an image in SQL Server which the user selects on the web page (.aspx) page. I will be continuing from the same process. The following interface is used: In the above screen shot, a textbox is there in which the Image id will be entered by the user which the user wants to display. Also the button will be used to show the same. And lastly an image control that will display the image fetched from the database. On the Show Image button the following coding is to be done. The hander is invoked with the help of following code: Protec