前台代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Role-Task.aspx.cs" Inherits="Admin_User_Role_Task_Role_Task" %>
<!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>
<style type="text/css">
.hidden
{display:none;}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<div style="z-index: 101; left: 19px; width: 232px; position: absolute; top: 5px;
height: 242px">
<asp:Label ID="Label1" runat="server" Text="角色列表"></asp:Label><br />
<asp:Panel ID="Panel2" runat="server" Height="500px" BorderColor="PeachPuff" BorderStyle="Double" ScrollBars="Auto">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2"
EmptyDataText="数据不存在……" Font-Size="Smaller" GridLines="None" OnRowCancelingEdit="GridView1_RowCancelingEdit"
OnRowCreated="GridView1_RowCreated" OnRowDeleting="GridView1_RowDeleting"
OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" Width="250px">
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<Columns>
<asp:BoundField DataField="RoleId" HeaderText="ID" ReadOnly="True">
<ItemStyle CssClass="hidden" Width="0px" />
<HeaderStyle CssClass="hidden" Width="0px" />
</asp:BoundField>
<asp:TemplateField HeaderText="角色名称">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("RoleName") %>' TextMode="MultiLine"
Width="168px"></asp:TextBox>
</EditItemTemplate>
<ItemStyle Width="180px" />
<HeaderStyle BackColor="#FFFFC0" ForeColor="Black" />
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("RoleName", "{0}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
Text="更新"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
Text="取消"></asp:LinkButton>
<ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="确要取消当前操作?"
TargetControlID="LinkButton2">
</ajaxToolkit:ConfirmButtonExtender>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="40px" />
<HeaderStyle Width="40px" />
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
Text="编辑"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
Text="删除"></asp:LinkButton>
<ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender2" runat="server" ConfirmText="确要删除数据?"
TargetControlID="LinkButton2">
</ajaxToolkit:ConfirmButtonExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowSelectButton="True" />
</Columns>
<RowStyle BackColor="#E3EAEB" ForeColor="#8C4510" Wrap="False" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="Blue" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="OldLace" BorderStyle="None" />
</asp:GridView>
<br />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</asp:Panel>
<table cellpadding="2" cellspacing="1">
<tr>
<td style="width: 3px">
<asp:TextBox ID="TextBox2" runat="server" Width="168px"></asp:TextBox></td>
<td style="width: 3px">
<asp:Button ID="Button1" runat="server" Text="添加角色" OnClick="Button1_Click" /></td>
</tr>
</table>
</div>
<div style="z-index: 102; left: 324px; width: 100px; position: absolute; top: 5px;
height: 100px">
<asp:Label ID="Label2" runat="server" Text="允许执行的任务列表" Width="200px"></asp:Label><br />
<asp:Panel ID="Panel1" runat="server" Height="500px" ScrollBars="Auto" BorderColor="PeachPuff" BorderStyle="Double">
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2"
EmptyDataText="数据不存在……" Font-Size="Smaller" GridLines="None"
OnRowCreated="GridView1_RowCreated" Width="250px">
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<Columns>
<asp:BoundField DataField="GongNengMiaoShu_Id" HeaderText="ID" ReadOnly="True">
<ItemStyle CssClass="hidden" Width="0px" />
<HeaderStyle CssClass="hidden" Width="0px" />
</asp:BoundField>
<asp:TemplateField HeaderText="允许">
<EditItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</EditItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="30px" />
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="GongNengMiaoShu" HeaderText="功能描述" />
</Columns>
<RowStyle BackColor="#E3EAEB" ForeColor="#8C4510" Wrap="False" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="Blue" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="OldLace" BorderStyle="None" />
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</asp:Panel>
<asp:Button ID="Button2" runat="server" Text="更新" /></div>
</form>
</body>
</html>