Step 1: Take a DataList and bind it with the images table and in the item Template write the image field this way:
<ItemTemplate>
<a id="small_Img" href='<%# Eval("imageurl" ,"images/{0}") %>'>
<asp:Image ID="ImgBtn1" runat="server" Height="20" Width="20" ImageUrl='<%# Eval("imageurl" ,"images/{0}") %>' />
</a>
</ItemTemplate>
Step 2: Take the fancyBox:
<script src="fbox/jquery.fancybox-1.3.4.pack.js" type="text/javascript"></script>
<link href="fbox/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function () {
$("a#small_Img").fancybox();
});
</script>
Download the fancybox from here :
<http://fancybox.net/>