Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Visible = true but not yet true
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Visible = true but not yet true
Environment versions
Environment:
ASP.NET
Miscellaneous
Thread ID:
01431096
Message ID:
01431096
Views:
112
On my VS2005 project I have a asp:label with visible="false" and a asp:hyperlink with visible="true". In the C# code I conditionally control it and another control's visibility. This code (simplifed example code fragment) doesn't work
if ( cond )
   {
   lblX.Visible = true;
   }
hypY.Visible = ! lblX.Visible;
When the page runs sure enough lblX is visible, but hypY stays visible. If I step through the code even after the execution of the lblX.Visible = true; the debugger shows the property value to still be false. I have to resort to this sort of hack code
bool bHack = false;
if ( cond )
   {
   lblX.Visible = true;
   bHack = true;
   }
hypY.Visible = ! bHack;
Why do I have to use an alternate variable? Why can't I get the accurate visibilty of lblX in order to control hypY's visibility?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Next
Reply
Map
View

Click here to load this message in the networking platform