.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 13th, 2003, 10:49 PM
Vantera Vantera is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: South Coast of NSW, Australia
Posts: 108 Vantera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Vantera
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

Reply With Quote
  #2  
Old October 15th, 2003, 03:21 AM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 7
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
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

Reply With Quote
  #3  
Old October 22nd, 2003, 09:48 PM
Vantera Vantera is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: South Coast of NSW, Australia
Posts: 108 Vantera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Vantera
Yeah I have managed to get around the problem but I still would like to know why it doesn't work the other way.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Can't use code block in boolean property.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT