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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hide panel based on Array

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
I have the following statement that I am using to see if a array holds any value or not and if it doesn't then I want to hide a panel, but right now this isn't working I ave tried both <= and >= and it doesn't work right. any suggestions would be great.

If dependents.length >= 0 then
strPanelName = &quot;depend&quot;
pnlPanel = FindControl( strPanelName )
pnlPanel.Visible = False

End If
 
um...if you're using >= or <=, then your code will fire no matter how many items are in the array.

Jack
 
that doesn't work

if I have this statement it is running the else part

if dependents.length = 0 then
response.write(&quot;no dependents&quot;)
else
response.write(&quot;dependents exist&quot;)
end if
 
Can I see the code where you have initialized the array as well as any between that initialization and your above code? That'l do donkey, that'l do
[bravo] Mark
 
You said

if it(the array) doesn't(hold a value) then I want to hide a panel

Consider the following code:
If dependents.length > 0 then
strPanelName = &quot;depend&quot;
pnlPanel = FindControl( strPanelName )
pnlPanel.Visible = False
End If

If dependents.length is greater than 0 (meaning there is an item), then it will hide the panel. Otherwise, it won't.

If this still isn't working for you, then post your array code please as Mark requested

Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top