ASP.Net中英文复合检索文本框实现思路及代码(3)


<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeFile="OrgRelation.aspx.cs"
Inherits="OrgRelation"%>

<!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 src="https://www.jb51.net/Scripts/jquery-1.8.2.js" type="text/javascript"></script>
<script src="https://www.jb51.net/Scripts/jquery-ui-1.9.0.custom.js" type="text/javascript"></script>
<link href="https://www.jb51.net/css/ui-lightness/jquery-ui-1.9.0.custom.css" type="text/css" />
<script type="text/javascript">
$(function () {
$("#selCompate").autocomplete({
source: "GetUser.ashx",
minLength: 1,
//以下为选中事件
select: function (event, ui) {
temp = ui.item;
$("#hidUserId").val(temp.id);
$("#hidUserName").val(temp.label);
$("#form2").attr("action", "./OrgRelation.aspx?UserId=" + temp.id + "&UserName=" + temp.label);
$("#form2").submit();
}
});
$("#selCompate").val($("#hidUserName").val())
});
</script>
</head>
<body>
<form method="post" action="./OrgRelation.aspx"></form>
<form method="post" runat="server" >
<input type="hidden" value="<%=currentUserId%>" />
<input type="hidden" value="<%=currentUserName%>"/>

<asp:ScriptManager runat="server">
</asp:ScriptManager>
<div>
<div>
<strong>编辑用户部门关系</strong>
</div>
<div>
<table>
<tr>
<td>
<div>
<b>选择用户:</b>&nbsp;
<asp:UpdatePanel runat="server">
<ContentTemplate>
<input type="text"
runat="server" />
</ContentTemplate>
</asp:UpdatePanel><br />
<b>选择部门:</b>
</div>
<br />
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td valign="top">
<div>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:TreeView runat="server" Font-Names="微软雅黑"
Font-Size="11pt" ForeColor="Black" BackColor="AliceBlue" OnTreeNodeCollapsed="TreeViewOrgData_TreeNodeCollapsed"
OnTreeNodeExpanded="TreeViewOrgData_TreeNodeExpanded" ShowCheckBoxes="All">
</asp:TreeView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</td>
<td valign="middle">
<p>

<asp:Button runat="server" Text="添加部门 >>"
BorderStyle="Solid" BorderColor="DarkGray" BackColor="GhostWhite" Font-Size="9pt"
OnClick="btnAddOrg_Click"></asp:Button></p>
<p>
<asp:Button runat="server" Text="<< 移除部门"
BorderStyle="Solid" BorderColor="DarkGray" BackColor="GhostWhite" Font-Size="9pt"
OnClick="btnRemoveOrg_Click"></asp:Button></p>

</td>
<td valign="top">
<div>
<asp:ListBox runat="server" Rows="13" BackColor="AliceBlue"
Font-Size="11pt" SelectionMode="Multiple" >
</asp:ListBox>
</div>
</td>
</tr>
</table>
</div>
<br />
<div>
<asp:Button runat="server" Text="·返 回·" BackColor="#f8f8ff" />&nbsp;&nbsp;
<asp:Button runat="server" Text="·保 存·" BackColor="#f8f8ff"
onclick="btnSave_Click" />
</div>
</div>
</form>
</body>
</html>


2.Global.asax中用户数据的准备

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjdzsy.html