今天在服务器端控件强制给加了个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
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