Setting a controls property in the .aspx : Visible=<%#...%>

A

Andrew Backer

I would like to be able to set the Visible property of a placeholder to
'false/true' via a normal function call rather than in the codebehind.


What I am aiming for is something approximating this :
<asp:placeHolder runat="server" Visible=<%#
MyNs.Class.StaticPropertyGet%> />

This works fine, as I would expect it to, inline :
<b>The value is = (<%=(bool)MyNs.Class.StaticPropertyGet%>) </b>

Is there any way I can put this kind of statement into a control and
have it do something? It apparently ignores it right now, since it
doesn't crash.

I am trying to get something really simple to work here, rather than
writing yet another single purpose control with lots 'o logic.

TIA,

Andrew Backer
 
A

Andrew Backer

IIRC it will do the tostring() automatically for you, but that is
neither here nor there (i hate it when ppl say that). It has been easy
to get to work in that context.

What I am trying to do is get that to work with a placeholder control.
All the versions that I try (that don't crash) do nothing to the
control, and the ones that work inline (not inside a server control)
all crap out. Why would it not crash, but still not do anything to the
'visible' property of the control?

I want to do something like this :

<asp:placeHolder runat="server" id="MyTest"
visible="<%# MyNs.Class.StaticPropertyGet %>">
.....
</asp:placeHolder>

Thanks in advance,
Andrew Backer
gmail://awbacker
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top