HI all,
I have got the answer.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script>
function MoveItem(ctrlSource, ctrlTarget) {
var Source = document.getElementById(ctrlSource);
var Target = document.getElementById(ctrlTarget);
if ((Source != null) && (Target != null)) {
while ( Source.options.selectedIndex >= 0 ) {
var newOption = new Option();
newOption.text = Source.options[Source.options.selectedIndex].text;
newOption.value = Source.options[Source.options.selectedIndex].value;
Target.options[Target.length] = newOption;
Source.remove(Source.options.selectedIndex);
}
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table height="150" width="300">
<tr>
<td>
<asp:ListBox id="ListBox1" runat="server" Height="111px" SelectionMode="Multiple">
<asp:ListItem Value="1">One</asp:ListItem>
<asp:ListItem Value="2">Two</asp:ListItem>
<asp:ListItem Value="3">Three</asp:ListItem>
</asp:ListBox>
</td>
<td>
<p>
<input onclick="Javascript:MoveItem('ListBox1', 'ListBox2');" type="button" value="->" />
</p>
<p>
<input onclick="Javascript:MoveItem('ListBox2', 'ListBox1');" type="button" value="<-" />
</p>
</td>
<td>
<asp:ListBox id="ListBox2" runat="server" Height="111px" SelectionMode="Multiple">
<asp:ListItem Value="8">Eight</asp:ListItem>
<asp:ListItem Value="9">Nine</asp:ListItem>
<asp:ListItem Value="10">Ten</asp:ListItem>
</asp:ListBox>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>