Typical scenario in data-centric RIA development is to insert into GridView control a web image corresponding to some "Image_URL" value stored in the data field of underlying database, which is "hyperlinked" to another "Target_URL" also stored in the database. Image OnClick event should open the target web page. In most general case the image could be missing, thus the alternative text should serve as a hyperlinked text. Three different solutions pertinent to ASP.NET GridView control are described below.

2. TemplateField with ImageButton

This technique though it provides the minimum coding and fairly robust results is not recommended as it uses PostBack and thus requires the server "round-trip", dramatically degrading the responsiveness of RIA and negatively impacting the overall user experience (it's brought here mostly for didactic purpose).

DEMO

ASP.NET GridView Hyperlinked image technique as described above has been used in Online Music Library: click on the sample snapshot shown below to see the working demo:

Design Notes: Server side Image rendering

Be aware that pertinent to Listing 1, the image is rendered as "img" element, while in two other cases it is rendered as "input type="image" element. Corresponding sample CSS3 code snippet in Listing 4 shows the best practices addressing these differences.