c# - asp:Content still visible when using Visible="False" -
i have master page couple contentplaceholder
inside , added content page of master page.
i set visible="false"
on 1 asp:content
in page it's not working i'm still able view data of both asp:content
controls.
why?
master page:
<%@ master language="c#" autoeventwireup="true" codebehind="masterbase.master.cs" inherits="masterbase" %> <!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"> </head> <body> <form id="form1" runat="server"> <!-- header --> <asp:contentplaceholder id="head" runat="server" /> <!-- content --> <asp:contentplaceholder id="bodycontent" runat="server" /> <!-- footer --> ... </form> </body> </html>
content page
<asp:content id="content1" contentplaceholderid="head" runat="server" visible="false"> <!-- data --> </asp:content> <asp:content id="content2" contentplaceholderid="bodycontent" runat="server"> <!-- data --> </asp:content>
try
mpcontentplaceholder = (contentplaceholder)master.findcontrol("content1"); mpcontentplaceholder.visible=false;
Comments
Post a Comment