Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CheckBoxList (making elements invisible)

Status
Not open for further replies.

SaadGilani

IS-IT--Management
May 30, 2003
2
US
Hello all,
I am new to asp.net. I have a checkboxlist consisting of 5 elements. I want these elements to be visible only when another check box is checked. I have written the following code but I get an error message BC30456 as shown at the very bottom of this post.
Regards,
SaadG.hq@keyence.com

******************************
Sub chkTimingFilter_CheckedChanged(sender As Object, e As EventArgs)

dim i as integer

if chkTimingFilter.checked = true then
chkAllTiming.enabled=true
chkAllTiming.visible=true
for i = 0 to chklTiming.items.count - 1
chklTiming.items(i).visible = true
next
else
chkAllTiming.enabled=false
chkAllTiming.visible=false
for i = 0 to chklTiming.items.count - 1
chklTiming.items(i).visible = false
next

end if
End Sub
**************************************

++++++++++++++++++++++++++++++++++++++++++++++++++++++
ERROR MESSAGE AS APPEARS ON MY BROWSER. I HAVE CUT AND PASTED...

Compiler Error Message: BC30456: 'visible' is not a member of 'System.Web.UI.WebControls.ListItem'.

Source Error:



Line 455: chkAllTiming.visible=true
Line 456: for i = 0 to chklTiming.items.count - 1
Line 457: chklTiming.items(i).visible = true
Line 458: next
Line 459: else


Source File: E:\HRWeb\list22.aspx Line: 457
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
I am taking a stab here... maybe will give you an idea...

ddl_departments.Items(i).Attributes("visible")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top