<%@ Import Namespace="System.Data" %>
<%@ Import namespace="System.Data.SqlClient" %>
<html>
<head>
<title>MultiView Navigation Using SetActiveView</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server" src="multiview.cs" />
<script language="C#" runat="server" src="~/shared/fetchData_sql.cs" />
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2>MultiView Navigation Using SetActiveView</h2></div>
<!-- #include virtual="~/shared/viewsrc_top.inc" -->
<hr size=1 width=92%>
<form runat="server">
<table align="center" cellpadding=0 cellspacing=0 width=92% style="table-layout: fixed">
<tr align="center" valign="top">
<td width=25%>
<table width=96%>
<tr align="center" class="select"><td>Select Destination</td></tr>
</table>
<asp:gridview id="gvCities" runat="server"
datasourceid="destinations" datakeynames="Country,StateProvince,City"
width=96% cellpadding=3
autogeneratecolumns=false
showheader=false font-size=9pt
allowpaging pagesize=20
onSelectedIndexChanged="getSelected"
onPageIndexChanged="resetSelected">
<selectedrowstyle backcolor="lightgreen" />
<pagersettings
mode="nextpreviousfirstlast" />
<pagerstyle
backcolor="steelblue" forecolor="beige"
horizontalalign="right" />
<columns>
<asp:templatefield>
<itemtemplate>
<asp:linkbutton runat="server" commandname="select"
text='<%# Eval ( "City" ) %>' />
</itemtemplate>
</asp:templatefield>
</columns>
</asp:gridview>
</td>
<td width=75%>
<div width=96%>
<asp:multiview id="mvImages" runat="server">
<asp:view id="viewThumbs" runat="server">
<div class="caption">Images of <%= ViewState [ "destination" ] %></div>
<br>
<asp:datalist id="lstImages" runat="server" width=100%
cellpadding=5 horizontalalign="center"
repeatcolumns=6 repeatdirection="horizontal"
onItemDataBound="setImages"
onItemCommand="showViewZoom">
<itemstyle width=20%
verticalalign="top" horizontalalign="center" />
<itemtemplate>
<asp:imagebutton id="imgThumb" runat="server"
style="border: 1px inset" width=120
onerror="this.src='/travel/images/default-image.gif'" />
</itemtemplate>
</asp:datalist>
</asp:view>
<asp:view id="viewZoom" runat="server">
<center>
<asp:formview id="fvZoom" runat="server"
onDataBound="getZoom"
onItemCommand="showViewThumbs">
<itemtemplate>
<table id="tbllmgZoom" runat="server" align="center" cellspacing=0>
<tr><td><div class="shortdesc"><asp:label id="lblCaption"
runat="server" /></div></td></tr>
<tr><td align="center"><asp:imagebutton id="imgZoom" runat="server"
style="border: 1px inset" /></div></td></tr>
<tr><td align="right"><asp:panel id="imgCredits" runat="server"
style="font:bold italic 9pt arial; color:navy; line-height:12pt" /></td></tr>
</table>
</itemtemplate>
</asp:formview>
</center>
</asp:view>
</asp:multiview>
</div>
</td></tr>
</table>
<asp:sqldatasource id="destinations" runat="server"
ConnectionString="<%$ ConnectionStrings:aspnet %>"
SelectCommand="SELECT Country, StateProvince, City FROM PopDests WHERE Country+City in ( SELECT DISTINCT Country+City FROM DestImages ) ORDER BY City" />
</form>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
<style type="text/css">
.select {
font: bold 13pt arial, verdana, sans serif; height: 30pt;
background:steelblue; color: beige }
.caption {
font: bold 13pt arial, verdana, sans serif; padding: 10;
background:darkslategray; color:palegoldenrod }
.shortdesc {
font: bold 11pt arial, verdana, sans serif; padding: 10;
background:darkslategray; color:palegoldenrod }
</style>
</body>
</html>