如何从母版页隐藏项目 [英] how to hide item from master page

查看:109
本文介绍了如何从母版页隐藏项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个母版页,一个是父母,另一个是孩子。在子母版页中有2个菜单如下:

i have two master pages,one is parent and another is child.In child master page there are 2 menus which as follow:

<ul id="nav">
                <li id="products"><a href="#" class="sub" tabindex="1"> My Products </a>
                     <ul>
                        <li><a href="../Developement/SysATQAAdd_product.aspx">Add Product</a></li>
                        <li><a href="../Developement/SysATQAManage_product.aspx">Manage Product</a></li>
                        <li><a href="../Developement/SysATQAProduct_catalogue.aspx">Product Catalogue</a></li>

                    </ul>

                </li>




<li><a href="#" class="sub" tabindex="1">Profile</a>
                   <ul>
                       <li><a href="../Developement/Change_profile.aspx">Change Profile</a></li>


                   </ul>
               </li>




当我登录时
帽子时间我想只显示个人资料菜单,有个人资料和产品页面。当我完成个人资料页面然后显示产品menu.plz帮助我?



when i login that time i want to show only profile menu and there is profile and product pages.when i complete profile page then it show product menu.plz help me?

推荐答案

你好,



您需要从母版页中找到控件,并且需要在子页面中检查配置文件完成的条件。然后,您可以显示或隐藏您的母版页控件。为此,您需要使用以下命令查找母版页控件:

Hi,

You need to find the control from master page and you need to check for the condition of profile completion in child page. Then you can show or hide your master page control. To achieve this you need to find the master page control using the following:
HtmlLink products = (HtmlLink)Page.Master.FindControl("products");
//if(Check the condition here){
     products.Visible = false;
//}







--Amit




--Amit


这也适用于多个母版页或具有母版页的aspx页面。< br $>


This will also works fine to be used in multiple Master Pages or aspx pages having Master page.

HtmlLink products = (HtmlLink)Master.FindControl("products");
products.Visible = false;


这篇关于如何从母版页隐藏项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆