Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to remove user control at run-time?
Message
From
26/12/2004 14:12:33
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00972037
Message ID:
00972208
Views:
16
This message has been marked as the solution to the initial question of the thread.
octrl = Page.FindControl("control")


>>>Page has user control (mycontrol.ascx)
>>>
>>>If I want to make it invisible or remove it in the Page_Load method, how do you do it?
>>>
>>
>>You probably don't need to remove it. Making it invisible has pretty much the same affect. All you need to do is set the Visible property to false and ASP.NET will basically skip output generation for this control (ie Render() doesn't fire).
>>
>>You can also use the Controls collection to remove the user control entirely.
>>
>
>My problem was that I could not figure out (still don't know how) to find this user control in the Controls collection. So I had to change the approach to get around this problem.
>
>Thank you for your input.
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform