给服务器控件添加客户端方法

 今天在服务器端控件强制给加了个ondbclik方法
function addLeftClick()
  {
   var right=document.getElementById("lstTarget");
   var vOption=document.createElement("option");
   vOption.text = right[right.selectedIndex].text;
    vOption.value=right[right.selectedIndex].value;
    vOption.id=right[right.selectedIndex].text;  
    var left = window.document.all("lstSource");
    left.add(vOption);
    right.remove(right.selectedIndex);
   
  }
  
  </script>
<asp:listbox id="lstTarget" runat="server" Width="150px" AutoPostBack="false" Height="226px" ondblclick="addLeftClick()"></asp:listbox></TD
原文地址:https://www.cnblogs.com/pbc1984/p/842190.html