brgdotnet
asked on
how to hide controls on an aspx web page using tags with an if then statement?
Hi Experts. I have some hyperlink controls that are located in a table on my web form. I need to hide these hyperlinks under certain conditions. I did something similar a few years ago, but cannot remember how I did it.
In my .Aspx code I had an if style statement that would allow me to hide or display certain controls. Does anyone know how to do this using .aspx tags? I don't recall how to do it?
In my .Aspx code I had an if style statement that would allow me to hide or display certain controls. Does anyone know how to do this using .aspx tags? I don't recall how to do it?
do it from code behind
ASKER
Hi xav056, I would prefer to do it in the code behind, but the architect wants it done in the aspx page. It can be done using tags < > somehow, but I don't know how.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
document.getElementById('< %=yourCont rolName.Cl ientId %>').display='none';
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This works fine in aspx pages, although <condition> must be declared as Public in codebehind.
<%If condition Then%>
<%End If%>
<%If condition Then%>
<%End If%>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.