Click here to Skip to main content
13,291,257 members (59,475 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » Howto » Downloads


38 bookmarked
Posted 4 Jan 2005

Fixing the IExtenderProvider in Visual Studio's ASP.NET designer

, 4 Jan 2005
An implementation of a custom CodeDomSerializer for repairing the IExtenderProvider in Visual Studio's ASP.NET designer.
namespace ASPExtenderSample
	using System;
	using System.Collections;
	using System.ComponentModel;
	using System.ComponentModel.Design.Serialization;
	using System.Web.UI.WebControls;	

	ProvideProperty("PrimitiveTest", typeof(Button)),
	ProvideProperty("EnumTest", typeof(Button)),
	ProvideProperty("StructTest", typeof(Button)),
	ProvideProperty("ClassTest", typeof(Button)),
	ProvideProperty("StringTest", typeof(Button)),
	DesignerSerializer(typeof(ASPExtenderSerializer), typeof(CodeDomSerializer))]
	public class WorkingProvider : Component, IExtenderProvider
		Hashtable _primitives = new Hashtable();
		Hashtable _enums = new Hashtable();
		Hashtable _structs = new Hashtable();
		Hashtable _classes = new Hashtable();
		Hashtable _strings = new Hashtable();

		public bool CanExtend(object extendee)
			return extendee is Button;
		public int GetPrimitiveTest(Button button)
				return (int)_primitives[button];
			return -1;

		public void SetPrimitiveTest(Button button, int primitive)
			_primitives[button] = primitive;

		public BindableSupport GetEnumTest(Button button)
				return (BindableSupport)_enums[button];
			return BindableSupport.Default;

		public void SetEnumTest(Button button, BindableSupport enumValue)
			_enums[button] = enumValue;

		public System.Drawing.Color GetStructTest(Button button)
				return (System.Drawing.Color)_structs[button];
			return System.Drawing.Color.Empty;

		public void SetStructTest(Button button, System.Drawing.Color structValue)
			_structs[button] = structValue;

		public Button GetClassTest(Button button)
			return _classes[button] as  Button;

		public void SetClassTest(Button button, Button classValue)
			_classes[button] = classValue;

		public string GetStringTest(Button button)
			return _classes[button] as String;

		public void SetStringTest(Button button, string stringValue)
			_classes[button] = stringValue;

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Wouter van Vugt
Web Developer Code Counsel
Netherlands Netherlands
Wouter van Vugt is a Microsoft MVP with Office Open XML technologies and an independent consultant focusing on creating Office Business Applications (OBAs) with SharePoint, the Office 2007 system and related .NET technologies. Wouter is a frequent contributor to developer community sites such as and MSDN and has published several white papers and articles as well a book available on line titled Open XML: the markup explained. Wouter is the founder of Code-Counsel, a Dutch company focusing on delivering cutting-edge technical content through a variety of channels. You can find out more about Wouter by reading his blog and visiting the Code-Counsel Web site.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171207.1 | Last Updated 5 Jan 2005
Article Copyright 2005 by Wouter van Vugt
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid