Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control Object Reference Generates IDE Error
Message
De
15/07/2009 13:48:47
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Application:
Web
Divers
Thread ID:
01412480
Message ID:
01412537
Vues:
38
BTW, I implemented the TypeConverter below and it works like a champ.

Thanks,
Bill

>Hi Bill,
>
>you can't assign a control to an attribute in ASP.NET. All you can do (and what ASP.NET does for many of its controls) is assigning the ID for the desired control. This would need to be a string property. In order to be able to select a MultiView in the properties window even for a String property, you need to implement a TypeConverter:
>
>	public class myButton : System.Web.UI.WebControls.Button
>	{
>		[TypeConverter(typeof(MultiViewConverter))]
>		public String MyView { get; set; }
>	}
>
>	public class MultiViewConverter : AssociatedControlConverter
>	{
>		protected override bool FilterControl(Control control)
>		{
>			return (control.GetType() == typeof(MultiView));
>		}
>	}
>
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform