Showing posts from February, 2011

Datalist Image

Was once wondering how to get images from the database and display it in a datalist control or a datagrid control in ASP.NET, and came across the following probable solution (alternate ideas on this would be appreciated ).


1.Get the image from the database and store it temporarily on the server side.
2.Set the ImageUrl property of the Image control to the temporary path.

Coding goes something like this,

aspx Page:

Datalist control included a image control and a label control to hold description.

            <asp:Image ID="Image1" runat="server" Width="50" Height="50"/>

now when binding the grid to the database,

it would have been straightforward if at all path of the image was stored in the data…