必须填写至少10个字的日志
nnhy authored at 2011-11-18 18:02:37
3.90 KiB
X
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SelectAdmin.aspx.cs" Inherits="Admin_SelectAdmin" %>

<!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>
    <base target="_self" />
    <link href="<%= ResolveUrl("~/Admin/images/css.css")%>" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div class="toolbar" style="text-align: center;">
            关键字:<asp:TextBox ID="txtKey" runat="server"></asp:TextBox>&nbsp; 角色:<XCL:DropDownList
                ID="DropdownList1" runat="server" DataSourceID="ObjectDataSource2" AppendDataBoundItems="true"
                DataTextField="Name" DataValueField="ID">
                <asp:ListItem Value="0">请选择</asp:ListItem>
            </XCL:DropDownList>
            <asp:Button ID="Button3" runat="server" Text="搜索" />
            &nbsp; 选择了:<asp:Label ID="lblmsg" runat="server" ForeColor="Red">未选择
            </asp:Label>(提示:双击选中)
        </div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
            DataSourceID="ObjectDataSource1" AllowPaging="True" AllowSorting="True" CssClass="m_table"
            PageSize="20" EnableModelValidation="True" GridLines="None">
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="编号" SortExpression="ID" InsertVisible="False"
                    ReadOnly="True">
                    <HeaderStyle Width="40px" />
                    <ItemStyle CssClass="key" HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="Name" HeaderText="用户名" />
                <asp:BoundField DataField="FriendName" HeaderText="友好名称" />
                <asp:BoundField DataField="RoleName" HeaderText="角色" SortExpression="RoleID" />
            </Columns>
            <EmptyDataTemplate>
                没有符合条件的数据!
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName=""
            DeleteMethod="Delete" EnablePaging="True" OldValuesParameterFormatString="original_{0}"
            SelectCountMethod="SearchCount" SelectMethod="Search" SortParameterName="orderClause"
            TypeName="">
            <SelectParameters>
                <asp:ControlParameter ControlID="txtKey" Name="key" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="DropdownList1" Name="roleId" Type="Int32" PropertyName="Text" />
                <asp:Parameter Name="orderClause" Type="String" />
                <asp:Parameter Name="startRowIndex" Type="Int32" />
                <asp:Parameter Name="maximumRows" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="FindAllByName" TypeName="" DataObjectTypeName="" DeleteMethod="Delete"
            InsertMethod="Insert" UpdateMethod="Update">
            <SelectParameters>
                <asp:Parameter Name="name" Type="String" />
                <asp:Parameter Name="value" Type="Object" />
                <asp:Parameter Name="orderClause" Type="String" />
                <asp:Parameter Name="startRowIndex" Type="Int32" />
                <asp:Parameter Name="maximumRows" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <XCL:GridViewExtender ID="gvExt" runat="server" OnRowDoubleClientClick="window.returnValue='{datakey}|||{cell2}';window.close();">
        </XCL:GridViewExtender>
    </div>
    </form>
</body>
</html>