div1,2,3,4,
层还是只显示了div1
List<int> sysList = (List<int>)DB_RoleRightManager.GetSysByRoleId(admin.RoleId);
string myscript = "";
foreach (int item in sysList)
{
  myscript += "showDiv('div"+item+"');";
}
Page.ClientScript.RegisterStartupScript(this.GetType(), "myscript", "<script>"+myscript+"</script>");function showDiv(divId)
    {
        document.getElementById(divId).style.display="block";
    }

解决方案 »

  1.   

    只显示了1  2 3 4 起作用了。。检查sysList里面的值
      

  2.   

    1、检查sysList 的值
    2、检查各个DIV是否存在遮盖(z-index)、大小设置问题
      

  3.   

    页面的<div class="margin-bottom20 mb xx" id="div1" runat="server"></div>
    没有遮盖,就算高度设置有问题,已经加了滚动条了myscript查出来是showDiv('div1');showDiv('div2');showDiv('div3');showDiv('div4');
      

  4.   


    代码和CSS样式发上来看下
      

  5.   


    <div id="main">
            <div id="left">
                <div class="nbbwork_title4">
                    <p>
                        <label>
                            当前用户:<asp:Label ID="lbl_admin" runat="server" Text="Label"></asp:Label></label></p>
                </div>
                <div class="p25" style="overflow: auto; height: 880px; width: 180px; margin-left: 10px;">
                    <div class="mb margin-bottom20" id="plgl">
                        <div class="nbbwork_title5">
                            <label>
                                评论管理</label></div>
                        <div class="_right">
                            <asp:TreeView ID="tvPrograma" runat="server" ShowLines="True" OnSelectedNodeChanged="tvPrograma_SelectedNodeChanged">
                            </asp:TreeView>
                        </div>
                    </div>
                    <div class="margin-bottom20 mb xx" id="div1" runat="server"></div>
    </div></div></div>.nbbwork_title4 p{margin-left:35px; margin-top:5px; color:#FFF;}
    .nbbwork_title5{background:url(img/ico1.gif) no-repeat; height:30px;}
    .nbbwork_title5 label{margin-left:30px;}
    #left{ width:248px; float:left;height:970px; background:url(img/nbb_left.png) no-repeat;}
    我没隐藏层的时候都能出来
      

  6.   

    Page.ClientScript.RegisterStartupScript(this.GetType(), "myscript", "<script>"+myscript+"</script>");
    加上type='text/javascript'行吗!!总是有人不写这个,估计是被挡住了
      

  7.   

    感觉是你的样式设计问题,是不是重叠了,
    如果你在前台body的onload方法中把你的4个div都show出来,看会不会显示完全?