<%@ Page Title="" Language="C#" ValidateRequest="false" MasterPageFile="~/BackCenter/Home/Edit.master" AutoEventWireup="true" CodeFile="RolePower.aspx.cs" Inherits="BackCenter_Role_RolePower" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContextPlaceHolder" runat="server">
   <%-- <script language="javascript" type="text/javascript">

        function OnTreeNodeChecked(event) {
            var ele = event.target || event.srcElement;
            if (ele.type == 'checkbox') {
                ele.className = "";
                var childrenDivID = ele.id.replace('CheckBox', 'Nodes');
                var div = document.getElementById(childrenDivID);
                if (div != null) {
                    var checkBoxs = div.getElementsByTagName('INPUT');
                    for (var i = 0; i < checkBoxs.length; i++) {
                        if (checkBoxs[i].type == 'checkbox')
                            checkBoxs[i].checked = ele.checked;
                    }
                }
                setParentClassName(ele);
            }
        }

        function setParentClassName(currCheckBox) {
            var objParentNode = public_GetParentNode(currCheckBox);
            if (public_IsObjectNull(objParentNode))
                return;
            var checkBoxs = objParentNode.getElementsByTagName("INPUT");

            var oneSelect = false;
            for (var i = 0; i < checkBoxs.length; i++) {
                if (checkBoxs[i].type == 'checkbox') {

                    if (checkBoxs[i].checked) {
                        oneSelect = true;break;
                    }

                }
            }
            var objParentCheckBox = public_Node2CheckBox(objParentNode);
            if (public_IsObjectNull(objParentCheckBox)) return;
            setParentClassName(objParentCheckBox);
            if (oneSelect) {
                objParentCheckBox.className = "";
                objParentCheckBox.checked = true;
                return;
            }
            objParentCheckBox.checked = false;
            objParentCheckBox.className = "parentbox_style";
        }


        //得到本节点所在的Node(Div对象)
        function public_GetParentNode(element) {
            var parent = element.parentNode;
            var upperTagName = "DIV";
            //如果这个元素还不是想要的tag就继续上溯
            while (parent && (parent.tagName.toUpperCase() != upperTagName)) {
                parent = parent.parentNode ? parent.parentNode : parent.parentElement;
            }
            return parent;
        }
        function public_Node2CheckBox(element) {
            var objID = element.getAttribute("ID");
            objID = objID.substring(0, objID.indexOf("Nodes"));
            return document.getElementById(objID + "CheckBox");
        }
        function public_IsObjectNull(element) {
            if (element == null || element == "undefined")
                return true;
            else
                return false;
        }

    </script>--%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <div class="r_top_line">
        <cite style="float: right">
            <img src="/App_Themes/BackCenter/images/right_tr.gif" /></cite></div>
    <div class="r_tit">
        <p class="home">
            位置：<a href="/">首页</a> >> <a href="#">角色权限管理</a>
        </p>
    </div>
    <div class="bd">
        <div class="tit_xs">
            <h2>
                角色权限管理
            </h2>
        </div>
        <table width="94%" border="0" cellpadding="0" cellspacing="0" class="tab_style fl">
            <tr>
                <td class="n1">
                    权限：
                </td>
                <td class="n2">
                    <asp:TreeView runat="server" onclick="OnTreeNodeChecked(event)" ID="tr_power" ShowCheckBoxes="All" ShowLines="True">
                    </asp:TreeView>
                </td>
            </tr>  
        </table>
        <div class="menu">
            <asp:Button ID="btnSave" CssClass="menu_b" runat="server" Text="保存" OnClick="btnSave_Click">
            </asp:Button>
            <input type="button" class="menu_o" value="返回" onclick="window.location.href='RoleIndex.aspx'" />
        </div>
    </div>
</asp:Content>

