<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebExample.WebForm1" %>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <HTML>
<HTML>
 <HEAD>
    <HEAD>
 <title>WebForm1</title>
        <title>WebForm1</title>
 <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
 <meta name="CODE_LANGUAGE" Content="C#">
        <meta name="CODE_LANGUAGE" Content="C#">
 <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_defaultClientScript" content="JavaScript">
 <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
 <script>
        <script>
 function Add()
           function Add()
 {
           {
 var elemAll = document.getElementById("lbAll");
             var elemAll = document.getElementById("lbAll");
 var elemSel = document.getElementById("lbSel");
             var elemSel = document.getElementById("lbSel");
 for(var i=0;i<elemAll.options.length;i++)
             for(var i=0;i<elemAll.options.length;i++)
 {
             {
 if(elemAll.options[i].selected)
                 if(elemAll.options[i].selected)
 {
                 { 
 var SelText=elemAll.options[i].innerText;
                     var SelText=elemAll.options[i].innerText;
 var SelValue = elemAll.options[i].value;
                     var SelValue = elemAll.options[i].value;
 var Num = elemSel.options.length;
                     var Num = elemSel.options.length;
 elemSel.options[Num]=new Option(SelText,SelValue);
                     elemSel.options[Num]=new Option(SelText,SelValue);
 elemAll.options.remove(i);
                     elemAll.options.remove(i);
 i--;
                     i--;
 }
                 }
 }
             }
 }
           }
 
           
 function Remove()
           function Remove()
 {
           {
 var elemAll = document.getElementById("lbAll");
              var elemAll = document.getElementById("lbAll");
 var elemSel = document.getElementById("lbSel");
             var elemSel = document.getElementById("lbSel");
 for(var i=0;i<elemSel.options.length;i++)
             for(var i=0;i<elemSel.options.length;i++)
 {
             {
 if(elemSel.options[i].selected)
                if(elemSel.options[i].selected)
 {
                {
 var SelText = elemSel.options[i].innerText;
                    var SelText = elemSel.options[i].innerText;
 var SelValue = elemSel.options[i].value;
                    var SelValue = elemSel.options[i].value;
 var Num = elemAll.options.length;
                    var Num = elemAll.options.length;
 elemAll.options[Num]= new Option(SelText,SelValue);
                    elemAll.options[Num]= new Option(SelText,SelValue);
 elemSel.options.remove(i);
                    elemSel.options.remove(i);
 i--;
                    i--;
 }
                }
 }
             }
 }
           }
 </script>
        </script>
 </HEAD>
    </HEAD>
 <body>
    <body>
 <form id="Form1" method="post" runat="server">
        <form id="Form1" method="post" runat="server">
 <TABLE>
            <TABLE>
 <TR>
                <TR>
 <TD>
                    <TD>
 <asp:ListBox id="lbAll" runat="server" Width="100px" Height="150px" SelectionMode="Multiple"></asp:ListBox></TD>
                        <asp:ListBox id="lbAll" runat="server" Width="100px" Height="150px" SelectionMode="Multiple"></asp:ListBox></TD>
 <TD>
                    <TD>
 <INPUT id="btnAdd" type="button" value=">>" onclick="Add();"><br>
                        <INPUT id="btnAdd" type="button" value=">>" onclick="Add();"><br>
 <INPUT id="btnRemove" type="button" value="<<" onclick="Remove();">
                        <INPUT id="btnRemove" type="button" value="<<" onclick="Remove();">
 </TD>
                    </TD>
 <TD>
                    <TD>
 <asp:ListBox id="lbSel" runat="server" Width="100px" Height="150px" SelectionMode="Multiple"></asp:ListBox></TD>
                        <asp:ListBox id="lbSel" runat="server" Width="100px" Height="150px" SelectionMode="Multiple"></asp:ListBox></TD>
 </TR>
                </TR>
 </TABLE>
            </TABLE>
 </form>
        </form>
 </body>
    </body>
 </HTML>
</HTML>
  
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML>
<HTML> <HEAD>
    <HEAD> <title>WebForm1</title>
        <title>WebForm1</title> <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" Content="C#">
        <meta name="CODE_LANGUAGE" Content="C#"> <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> <script>
        <script> function Add()
           function Add() {
           { var elemAll = document.getElementById("lbAll");
             var elemAll = document.getElementById("lbAll"); var elemSel = document.getElementById("lbSel");
             var elemSel = document.getElementById("lbSel"); for(var i=0;i<elemAll.options.length;i++)
             for(var i=0;i<elemAll.options.length;i++) {
             { if(elemAll.options[i].selected)
                 if(elemAll.options[i].selected) {
                 {  var SelText=elemAll.options[i].innerText;
                     var SelText=elemAll.options[i].innerText; var SelValue = elemAll.options[i].value;
                     var SelValue = elemAll.options[i].value; var Num = elemSel.options.length;
                     var Num = elemSel.options.length; elemSel.options[Num]=new Option(SelText,SelValue);
                     elemSel.options[Num]=new Option(SelText,SelValue); elemAll.options.remove(i);
                     elemAll.options.remove(i); i--;
                     i--; }
                 } }
             } }
           } 
            function Remove()
           function Remove() {
           { var elemAll = document.getElementById("lbAll");
              var elemAll = document.getElementById("lbAll"); var elemSel = document.getElementById("lbSel");
             var elemSel = document.getElementById("lbSel"); for(var i=0;i<elemSel.options.length;i++)
             for(var i=0;i<elemSel.options.length;i++) {
             { if(elemSel.options[i].selected)
                if(elemSel.options[i].selected) {
                { var SelText = elemSel.options[i].innerText;
                    var SelText = elemSel.options[i].innerText; var SelValue = elemSel.options[i].value;
                    var SelValue = elemSel.options[i].value; var Num = elemAll.options.length;
                    var Num = elemAll.options.length; elemAll.options[Num]= new Option(SelText,SelValue);
                    elemAll.options[Num]= new Option(SelText,SelValue); elemSel.options.remove(i);
                    elemSel.options.remove(i); i--;
                    i--; }
                } }
             } }
           } </script>
        </script> </HEAD>
    </HEAD> <body>
    <body> <form id="Form1" method="post" runat="server">
        <form id="Form1" method="post" runat="server"> <TABLE>
            <TABLE> <TR>
                <TR> <TD>
                    <TD> <asp:ListBox id="lbAll" runat="server" Width="100px" Height="150px" SelectionMode="Multiple"></asp:ListBox></TD>
                        <asp:ListBox id="lbAll" runat="server" Width="100px" Height="150px" SelectionMode="Multiple"></asp:ListBox></TD> <TD>
                    <TD> <INPUT id="btnAdd" type="button" value=">>" onclick="Add();"><br>
                        <INPUT id="btnAdd" type="button" value=">>" onclick="Add();"><br> <INPUT id="btnRemove" type="button" value="<<" onclick="Remove();">
                        <INPUT id="btnRemove" type="button" value="<<" onclick="Remove();"> </TD>
                    </TD> <TD>
                    <TD> <asp:ListBox id="lbSel" runat="server" Width="100px" Height="150px" SelectionMode="Multiple"></asp:ListBox></TD>
                        <asp:ListBox id="lbSel" runat="server" Width="100px" Height="150px" SelectionMode="Multiple"></asp:ListBox></TD> </TR>
                </TR> </TABLE>
            </TABLE> </form>
        </form> </body>
    </body> </HTML>
</HTML> 
                    
                     
                    
                 
                    
                 

 
        
 
         
            
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号