Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control Object Reference Generates IDE Error
Message
From
15/07/2009 13:48:47
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Application:
Web
Miscellaneous
Thread ID:
01412480
Message ID:
01412537
Views:
39
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform