|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Can't use code block in boolean property.
I'm trying to do something like this:
<asp:Button ... Visible="<%= ShowButton %>">...</asp:Button> ...and ShowButton is boolean. Basically I want to be able to hide or show a control depending on whether or not another control is visible or not, but even the basic example above won't work. I get a parser error "Not valid for Boolean". I can do the same thing using binding - <%# ShowButton %> - but it means I have to then call DataBind on the control which I would prefer not to have to do. I've tried using different quotes as well as no quotes at all but nothing seems to work. Can someone please try this out themselves and see if they can get it to work? Thanks in advance.
__________________
Kind Regards, John Rebbeck john@interspire.com ICQ# 74637937 |
|
#2
|
|||
|
|||
|
just do it in the code behind file in the page_load sub.
Code:
Dim ShowButton as Boolean ..... myButton.Visible = IIf(ShowButton = False, False, True)
__________________
- Rogier Doekes |
|
#3
|
|||
|
|||
|
Yeah I have managed to get around the problem but I still would like to know why it doesn't work the other way.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > Can't use code block in boolean property. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|