Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programming UserControls
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01330659
Message ID:
01330697
Vues:
18
This message has been marked as a message which has helped to the initial question of the thread.
>
>Interesting. Does it mean I can do something like
>
>FormView frmRegular = (FormView) this.Page.FindControl("myFormViewName")
>if ...
Can you? Yes, it should work. However I wouldn't do an explicit cast and I wouldn't hardcode in the control name. If the control doesn't exist your code will throw an exception. Instead, something like:
FormView regular = Page.FindControl(this.FormViewNameProperty) as FormView;

if (regular != null)
(you'd need to create a property in your user control, I'm using FormViewNameProperty as an example).

You may also need to think about what happens when you've got multiple instances of the same user control on the form.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform