<html>
<head>
<title>Image Control Example</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server">
void getImage ( object src, EventArgs e ) {
theImage.ImageUrl = "~/shared/images/" + imgList.SelectedValue;
theImage.AlternateText = imgList.SelectedItem.Text;
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2>Image Control Example</h2></div>
<!-- #include virtual="~/shared/viewsrc_top.inc" -->
<hr size=1 width=92%>
<center>
<form runat="server">
<asp:image id="theImage" runat="server"
imageurl="/shared/images/earth.gif"
alternatetext="Earth" />
<p>Select image file:
<asp:dropdownlist id="imgList" runat="server"
onSelectedIndexChanged="getImage" autopostback>
<asp:listitem value="earth.gif">Earth</asp:listitem>
<asp:listitem value="jupiter.gif">Jupiter</asp:listitem>
<asp:listitem value="mars.gif">Mars</asp:listitem>
<asp:listitem value="mercury.gif">Mercury</asp:listitem>
<asp:listitem value="neptune.gif">Neptune</asp:listitem>
<asp:listitem value="pluto.gif">Pluto</asp:listitem>
<asp:listitem value="saturn.gif">Saturn</asp:listitem>
<asp:listitem value="uranus.gif">Uranus</asp:listitem>
<asp:listitem value="venus.gif">Venus</asp:listitem>
</asp:dropdownlist>
<!-- <asp:button text="Apply" onClick="getImage" runat="server" /> -->
</form>
</center>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>