当前位置:编程学习 > C#/ASP.NET >>

关于UL LI的显示和隐藏

默认各个ul 和 li都是隐藏,然后根据另一页面的字段的值来决定各个li是否显示

比如另一个页面的某一字段包含当前客户查询,那就显示:信息查询和当前信息查询

求指教!

<ul>
                    <li id="a_0" name="kkkk" class="hover"><a class="a01" href="javascript:void(0)"  onclick="showLMenu(0,7);changeP1(0)">
                        <span id="sp_0">信息查询</span></a>
                        <ul id="ul1">
                            <li><a href="NowCompany.aspx<%=strUrl %>" target="main" onclick="changeP2(0)" 
                                    id="li_0" >当前客户查询</a> </li>
                                                             
                            <li><a href="HistoryCompany.aspx<%=strUrl %>" target="main" onclick="changeP2(2)" id="li_2" >
                                历史客户查询</a></li>
                        </ul>
                    </li>
                    <li id="a_1"><a href="javascript:void(0)" class="a02"  onclick="showLMenu(1,7);changeP1(1)">
                        <span id="sp_1">服务统计</span></a>
                        <ul>
                        <%=strProfit%>
                            <li><a href="NowInfo.aspx<%=strUrl %>" target="main" onclick="changeP2(6)" id="li_6">当前服务情况</a></li>
                            <li><a href="HistoryInfo.aspx<%=strUrl %>" target="main" onclick="changeP2(7)" id="li_7">历史服务情况</a></li>
                        </ul>
                    </li>
                    <li id="a_2"><a href="javascript:void(0)" class="a03"  onclick="showLMenu(2,7);changeP1(2)">
                        <span id="sp_2">账款情况</span></a>
                        <ul>
                            <li><a href="NowServerMoney.aspx<%=strUrl %>" target="main" onclick="changeP2(8)" id="li_8">账款查看</a></li>
                           <%-- <li><a href="HistoryServerMoney.aspx<%=strUrl %>" target="main" onclick="changeP2(9)" id="li_9">历史服务收入</a></li>
                            <li><a href="OverDraft.aspx" target="main" onclick="changeP2(10)" id="li_10">欠款统计</a></li>--%>
                        </ul>
                    </li>
</ul>

--------------------编程问答-------------------- --------------------编程问答-------------------- 不合适吧! --------------------编程问答-------------------- asp.net不熟,不过这个貌似应该可以这样吧


 <%if (true) %>
 <li id="a_0" name="kkkk" class="hover"><a class="a01" href="javascript:void(0)"  onclick="showLMenu(0,7);changeP1(0)">
                        <span id="sp_0">信息查询</span></a>
                        <ul id="ul1">
 <%if(false) %>
                            <li><a href="NowCompany.aspx<%=strUrl %>" target="main" onclick="changeP2(0)" 
                                    id="li_0" >当前客户查询</a> </li>

--------------------编程问答-------------------- http://topic.csdn.net/u/20081012/13/4EA5658B-B437-4798-ABAF-6CB5C4358892.html --------------------编程问答-------------------- http://bbs.blueidea.com/thread-2905088-1-1.html
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,