Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to remove user control at run-time?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00972037
Message ID:
00972152
Vues:
15
>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.

+++ Rick ---
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform