<%@ Page language="c#" autoeventwireup="false"%>
<html>
<head>
<script language="c#" runat="server" ID=Script1>
private void UpdateButton_Click(Object sender, EventArgs e)
{
GroupList.SelectedIndex = UserList.SelectedIndex;
}
</script>
</head>
<body>
<form runat="server">
<h3>Using ListBox</h3>
<TABLE WIDTH="300" BORDER="0" CELLSPACING="1" CELLPADDING="1">
<TR>
<TD NOWRAP>Users:</TD>
<TD NOWRAP></TD>
<TD NOWRAP></TD>
</TR>
<TR>
<TD NOWRAP>
<asp:ListBox id="UserList" runat="server" Rows="4">
<asp:ListItem>Paula</asp:ListItem>
<asp:ListItem>Chris</asp:ListItem>
<asp:ListItem selected="True">Eric</asp:ListItem>
<asp:ListItem>Wynn</asp:ListItem>
</asp:ListBox>
</TD>
<TD NOWRAP>
<asp:button text="Update ->" runat="server" ID="UpdateButton" onclick="UpdateButton_Click"/>
</TD>
<TD NOWRAP>
<asp:ListBox id="GroupList" runat="server" Rows="4">
<asp:ListItem>Paula</asp:ListItem>
<asp:ListItem>Chris</asp:ListItem>
<asp:ListItem>Eric</asp:ListItem>
<asp:ListItem>Wynn</asp:ListItem>
</asp:ListBox>
</TD>
</TR>
</TABLE>
</form>
</body>
</html>