How to make a UserControl Invisible dynamically

R

Richard Chen

Hi all,

I found setting Visible property to be false does not make a user control
invisible.

For ASP.NET, it doesn't provide property like InvisibleAtRuntime.

I tried to remove that user control when it is set to be invisible but ended
up having the ControlCollection range violated...

Any better ideas? Thanks in advance

Richard Chen
 
P

Philipp Sumi

Hi Richard

Working with the Visible property should work. Are you sure your object
reference in code matches the user control's declaration in your HTML?

If you don't want to reference your UserControl in code: Just put the
UserControl in a Panel and work with the Panel's Visible property...

hth, Philipp
 
R

Robert Koritnik

Use PlaceHolder control insted of Panel while it renders to NOTHING and
consumes less resources.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,074
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top