hiding a user control

M

Michelle Stone

I tried setting the VISIBLE property of my User Control
to False in the designer, and I got the expected result -
the control disappeared.

But when I try to do this through code, it doesn't work!

I used the following in the Page_Load function

myControl = (TheControl) LoadControl ("TheControl.ascx");
myControl.Visible = false;

Additional Comments:
====================
1. In the designer, I have given "myControl" as the ID
for the user control
2. I have added "public TheControl myControl" to the list
of class variables in the beginning of the class

Thanks....
 

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

Top