页面上处理true 和false

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelUserInfoPage.aspx.cs" Inherits="HeartFly.UI.Admin.SelUserInfoPage" %>

<!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="js/checkAll.js" type="text/javascript"></script>

    <link href="css/admin.css" rel="stylesheet" type="text/css" />
    <style>
        td
        {
            padding:3px;
            font-size:13px;
        }
    </style>
</head>
<body>

   
    <form id="form1" runat="server">
    <asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager>
    <div align="center">
     
         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
      <div style="width:100%" align="center">
            <table style="width:90%">
                <tr style="width:100%; background:#e2e2e2;">
                    <td><b>用户管理</b></td>
                </tr>
            </table>
        </div>
        <div style="width:100%">
        <asp:GridView ID="gvUserInfo" runat="server" AutoGenerateColumns="False"
                Width="90%" BackColor="#fdffff" BorderColor="#CCCCFF" BorderStyle="Solid"
                BorderWidth="1px" CellPadding="0" ForeColor="Black"
                onrowcommand="gvUserInfo_RowCommand" onrowdatabound="gvUserInfo_RowDataBound"
                onrowdeleting="gvUserInfo_RowDeleting"
                onrowupdating="gvUserInfo_RowUpdating">
            <RowStyle Height="5px" />
            <Columns>
                <asp:BoundField DataField="userID" HeaderText="编号"
                    ItemStyle-HorizontalAlign="Center" ItemStyle-Font-Size="13px" >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemStyle Width="40px"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField DataField="userName" HeaderText="登录名"
                    ItemStyle-HorizontalAlign="Center"  ItemStyle-Font-Size="13px" >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemStyle Width="100px"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField DataField="userPassword" HeaderText="密码"
                    ItemStyle-HorizontalAlign="Center" ItemStyle-Font-Size="13px" >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemStyle Width="100px"></ItemStyle>
                </asp:BoundField>
                <asp:TemplateField HeaderText="状态" ItemStyle-HorizontalAlign="Center"  ItemStyle-Font-Size="13px">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%#Eval("userState") %>' Visible="false"></asp:Label>
                                    <%#Convert.ToInt32(Eval("userState"))== 1? "<font color='#FF0000'>在线</font>":"离线"  %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作" ItemStyle-HorizontalAlign="left"  ItemStyle-Font-Size="13px">
              
                    <ItemTemplate >
                        <asp:LinkButton ID="linbtnRight" runat="server" CommandArgument='<%#Eval("userID")+","+Eval("userName")%>' CommandName="select" Visible='<%#isUpdate %>' >查看权限</asp:LinkButton>&nbsp;&nbsp;&nbsp;
                        <asp:LinkButton ID="linbtnUpdate" runat="server" CommandArgument='<%#Eval("userID")+","+Eval("userName")+","+Eval("userPassword") %>' CommandName="update"  Visible='<%#isUpdate %>'>修改</asp:LinkButton>&nbsp;&nbsp;&nbsp;
                        <asp:LinkButton ID="linbtnDelete" runat="server" CommandArgument='<%#Eval("userID")+","+Eval("userName")%>' CommandName="delete"  Visible='<%#isDelete%>'>删除</asp:LinkButton>
                    </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="选" ItemStyle-HorizontalAlign="Center"  ItemStyle-Font-Size="13px" >
                    <HeaderTemplate>
                        <input id="checkAll" name="checkAll" type="checkbox" οnclick="CKAll()" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="ck" runat="server" />
                    </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle BackColor="#E9FBD2" BorderWidth="1px" Font-Names="宋体"
                Font-Size="14px" BorderColor="#CCCCFF" />
        </asp:GridView>
        </div>
        <div>
        <table width="90%">
            <tr>
                <td style="width:20%" align="left">当前第<%= NowPage+1%>页&nbsp;&nbsp;&nbsp;&nbsp;共<%= AllPage%>页</td>
                <%--<td style="width:20%" align="center">每页显示<asp:TextBox ID="txtRows" runat="server"
                        Width="30px"></asp:TextBox>行</td>--%>
                <td style="width:60%" align="center">
                    <asp:Button ID="btnFristPage" runat="server" Text="首页" οnclick="btnFristPage_Click"  CssClass="buttoncss"  />
                    <asp:Button ID="btnUpPage" runat="server" Text="上一页"
                        οnclick="btnUpPage_Click"   CssClass="buttoncss"/>
                    <asp:Button ID="btnDownPage" runat="server" Text="下一页"
                        οnclick="btnDownPage_Click"  CssClass="buttoncss"/>
                    <asp:Button ID="btnLastPage" runat="server" Text="尾页"
                        οnclick="btnLastPage_Click"   CssClass="buttoncss"/>
                    <asp:Button ID="btnDelectCheck" runat="server" Text="删除选中项"
                        οnclick="btnDelectCheck_Click"  CssClass="buttoncss"/>
                    <input id="btnReset" type="reset" value="取消选中项"  class="buttoncss"/>
                    </td>
                </tr>
        </table>
        </div>
       <div align="center" id="userRights" runat = "server" style=" height: 80px; width:90%"></div>
    </ContentTemplate>
    </asp:UpdatePanel>
    </div>
  
    </form>
</body>
</html>

 

 

<asp:TemplateField HeaderText ="操作">
                <ItemTemplate>
                    <asp:LinkButton ID="lbUpdate1" runat ="server" CommandName ="Update1" Visible='<%#Eval("UserRole").ToString() !="管理员" ?true:false %>' CommandArgument='<%#Eval("ID") %>'><%#Eval("UserStates1")%></asp:LinkButton>
                    <%--<asp:LinkButton ID="lbUpdate2" runat ="server" CommandName ="Update2" CommandArgument='<%#Eval("ID") %>'>启用</asp:LinkButton>--%>
                    <asp:LinkButton ID="lbDelete" runat ="server" CommandName ="Delete" Visible='<%#Eval("UserRole").ToString() !="管理员" ?true:false %>' CommandArgument='<%#Eval("ID") %>'>删除</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值