这篇文章主要介绍了asp.net listbox单选全选取消的应用,需要的朋友可以参考下
前台
复制代码 代码如下:
<head runat="server">
<title>部门多选</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<SCRIPT language="javascript" type="text/javascript">
function Ok()
{
window.close();
opener.document.all.txtOtherMan.value = window.Form2.hide.value;
}
function Cancel()
{
window.close();
}
</SCRIPT>
</head>
<body>
<form id="Form2" method="post" runat="server">
<TABLE style="WIDTH: 600px; POSITION: absolute; HEIGHT: 320px" cellSpacing="0" cellPadding="0" border="0">
<TR>
<TD style="WIDTH: 600px; HEIGHT: 20px">
<INPUT id="hide" type="hidden" value="<%=pass()%>">
<BUTTON id="ok" onclick="javascript:Ok();" type="button">确定</BUTTON>
<BUTTON id="cancel" onclick="javascript:Cancel();" type="button">取消</BUTTON>
<%-- <asp:Button ID="Button1" runat="server" Text="确定" OnClick="Button1_Click" />--%>
</TD>
</TR>
<TR>
<TD style="WIDTH: 600px; height: 310px;" vAlign="top" align="left">
<DIV class="box" style="WIDTH: 600px ;HEIGHT: 300px; left: 0px; top: 0px;">
<asp:listbox id="UserList" style="Z-INDEX: 105; LEFT: 27px; POSITION: absolute; TOP: 56px" runat="server" Height="201px" Width="200px" SelectionMode="Multiple" DataTextField="Name" DataValueField="Name"></asp:listbox>
<asp:listbox id="lstSelEmp" style="Z-INDEX: 106; LEFT: 317px; POSITION: absolute; TOP: 58px" runat="server" Height="202px" Width="211px"></asp:listbox>
<asp:label id="Label4" style="Z-INDEX: 107; LEFT: 30px; POSITION: absolute; TOP: 32px" runat="server" CssClass="tttable">选取部门:</asp:label>
<asp:label id="Label5" style="Z-INDEX: 108; LEFT: 316px; POSITION: absolute; TOP: 34px" runat="server" CssClass="tttable" Height="18px" Width="108px">已选定部门:</asp:label>
新闻热点
疑难解答