Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control Object Reference Generates IDE Error
Message
 
To
15/07/2009 09:45:14
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:
01412510
Views:
43
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));
		}
	}
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform