I have used Dummy DataTable.
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form2" runat="server">
<div>
<asp:MultiView ID="MultiView1" ActiveViewIndex="0" runat="server">
<asp:View ID="View1" runat="server">
<asp:DataList ID="DataList1" runat="server">
<HeaderTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<th>
Id
</th>
<th>
Name
</th>
<th>
Coutry
</th>
<th>
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label ID="lblId" Text='<%# Eval("Id") %>' runat="server" />
</td>
<td>
<asp:Label ID="lblName" Text='<%# Eval("Name") %>' runat="server" />
</td>
<td>
<asp:Label ID="lblCountry" Text='<%# Eval("Country") %>' runat="server" />
</td>
<td>
<asp:ImageButton ID="ImageButton1" ImageUrl="~/Images/transfer.png" OnClick="GetDetails"
runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:DataList>
</asp:View>
<asp:View ID="View2" runat="server">
<table>
<tr>
<td>
Id =
</td>
<td>
<asp:Label ID="lblId" Text="" runat="server" />
</td>
</tr>
<tr>
<td>
Name
</td>
<td>
<asp:Label ID="lblName" Text="" runat="server" />
</td>
</tr>
<tr>
<td>
Country
</td>
<td>
<asp:Label ID="lblCountry" Text="" runat="server" />
</td>
</tr>
</table>
</asp:View>
</asp:MultiView>
</div>
</form>
</body>
</html>
Namespace
using System.Data;
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[3] { new DataColumn("Id", typeof(int)),
new DataColumn("Name", typeof(string)),
new DataColumn("Country",typeof(string)) });
dt.Rows.Add(1, "John Hammond", "United States");
dt.Rows.Add(2, "Mudassar Khan", "India");
dt.Rows.Add(3, "Suzanne Mathews", "France");
dt.Rows.Add(4, "Robert Schidner", "Russia");
this.DataList1.DataSource = dt;
this.DataList1.DataBind();
}
}
protected void GetDetails(object sender, EventArgs e)
{
DataListItem dlist = (sender as ImageButton).NamingContainer as DataListItem;
this.MultiView1.ActiveViewIndex = 1;
this.lblId.Text = (dlist.FindControl("lblId") as Label).Text;
this.lblName.Text = (dlist.FindControl("lblName") as Label).Text;
this.lblCountry.Text = (dlist.FindControl("lblCountry") as Label).Text;
}
Similar you can search the Data from SQL with image name and put the details in second View of MultiView control.