c# - The visible property of a Label act as read only -


i have label within user control:

<asp:label runat="server" id="lblremainingplacesmessage" visible="false" /> 

i want setup visibility true:

protected void page_load(object sender, eventargs e) {     lblremainingplacesmessage.visible = true; } 

however, label still hidden.

what's puzzling me, property can't changed, in immediate window, or debugger local watch:

(immediate window)

lblremainingplacesmessage.visible false lblremainingplacesmessage.visible = true true lblremainingplacesmessage.visible false 

what can explain visible property can't changed?

i have no exception. noop operation...

my app has viewstate enabled. of all, have other label in page, works perfectly!

don't know if matter, dynamically instantiate user control within owner page using:

    protected override void createchildcontrols()     {         m_visualcontrol = (myusercontrol)page.loadcontrol(_ascxpath);         controls.add(m_visualcontrol);     } 

the app uses asp.net webforms .net 3.5 sp1, , use visual studio 2012 premium.

yuriy galanter's comment put me on right track.

simply, immediate parent not visible. , suppose visible property of control combines control ancestors visibility.

sometimes simple problem have simple resolution :)


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -