Click to See Complete Forum and Search --> : Unable to set div's Visible property to true


dannystommen
August 10th, 2010, 10:31 AM
Hi guys,

I have the following markup

<div class="validation clear" runat="server" id="div_MyDiV" visible="false">
Some text
</div>

and code behind

div_MyDiV.Visible = true;


When I debug, the visible property is false, and after stepping over de line, it's still false?!?!

Any ideas?

Alsvha
August 11th, 2010, 04:31 AM
Try setting it in the PreRender page event and see if it helps - my guess is that your assignment of true is overwritten

dannystommen
August 11th, 2010, 05:57 AM
I've used this a dozen of times before, always in the page load.

Anyway, it wasn't visible because of some other reason. It works fine now. Only thing I don't understand is why the debugger always show that Visible=false.


my guess is that your assignment of true is overwritten

I looked at it the first step after setting the Visible property to true. When would it be overwritten then?