menu.aspx
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:5k
源码类别:
OA系统
开发平台:
ASP/ASPX
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="menu.aspx.cs" Inherits="web_system_menu" %>
- <!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>
- <link href="../../css/style.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript"language = "javascript">
- function selectMenu()
- {
- var url = "menu_select_tree.aspx";
- var features = "width=400,height=500,top=200,left=250,location=no,toolbar=no,status=no,resizable=yes,scrollbars=yes";
- var selectMenu = open(url, 'selectMenu', features);
- selectMenu.focus();
- }
- function setMenu(id, name)
- {
- document.all.ParentId.value=id;
- document.all.TxtParent.value=name;
- }
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <center>
- <asp:Label ID="LblTitle" runat="server" Text="OA系統選單管理" Font-Bold="True" Font-Size="Medium"></asp:Label>
- </center>
- <center>
- </center>
- <asp:GridView ID="MenuList" runat="server" AutoGenerateColumns="False" BackColor="White"
- BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="SqlDataSource1"
- GridLines="Vertical" Style="left: 136px; position: relative; top: 1px;" AllowPaging="True" AllowSorting="True" OnRowDataBound="MenuList_RowDataBound" Width="500px">
- <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
- <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
- <Columns>
- <asp:BoundField DataField="name" HeaderText="選單名稱" SortExpression="name" />
- <asp:BoundField DataField="parent" HeaderText="上級選單" SortExpression="parent" />
- </Columns>
- <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
- <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
- <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
- <AlternatingRowStyle BackColor="Gainsboro" />
- </asp:GridView>
- <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:oaConnection %>"
- SelectCommand="SELECT m.id, m.name, p.name parent FROM dbo.OA_SYS_CHILD_MENU AS m INNER JOIN dbo.OA_SYS_CHILD_MENU AS p ON m.parent_id = p.id ORDER BY m.name">
- </asp:SqlDataSource>
- <br />
- <br />
- <center>
- <asp:Panel ID="PnlMenu" runat="server" Visible="False">
- <table style="position: relative; width: 500px;" border="1">
- <tr>
- <td style="width: 91px" align="center">
- <asp:Label ID="LblName" runat="server" Text="選單名稱" ></asp:Label>
- </td>
- <td style="width: 142px" align="left">
- <asp:TextBox ID="TxtName" runat="server" Width="200px"></asp:TextBox>
- <asp:Label ID="LblErrName" runat="server" ForeColor="Red" Style="position: relative"></asp:Label></td>
- </tr>
- <tr>
- <td style="width: 91px" align="center">
- <asp:Label ID="LblParent" runat="server" Text="上級選單"></asp:Label>
- </td>
- <td style="width: 142px" align="left">
- <input id="TxtParent" type="text" runat="server" disabled="disabled" style="width: 200px">
- <input id="ParentId" runat="server" type="hidden" />
- <input id="BtnSelect" onclick="selectMenu()" type="button" value="選擇上級選單"/>
- <asp:Label ID="LblErrParent" runat="server" ForeColor="Red" Style="position: relative"></asp:Label></td>
- </tr>
- <tr>
- <td style="width: 91px" align="center">
- <asp:Label ID="LblOpen" runat="server" Text="是否顯示"></asp:Label>
- </td>
- <td style="width: 142px" align="left">
- <asp:DropDownList ID="DdlOpen" runat="server" Width="49px">
- <asp:ListItem Value="Y">是</asp:ListItem>
- <asp:ListItem Value="N">否</asp:ListItem>
- </asp:DropDownList>
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <asp:Button ID="BtnOk" runat="server" Text="儲存" OnClick="BtnOk_Click" /></td>
- </tr>
- </table>
- </asp:Panel>
- </center>
- </div>
- </form>
- </body>
- </html>