Search code examples
asp.netvisual-studio-2010custom-server-controls

How can I expose a public property of a server control in the Properties window?


I have an ASP.NET server control with some public properties.

If I drop the server control onto a form, I can access those properties from the code-behind. But I'd like to set them in the Properties window of the form designer.

The properties are just strings and booleans, not complex types. I'm using Visual Studio 2010 and .NET 4.0.

How can I expose server control properties to the Properties window in Design mode?


Solution

  • Here's an oldie but a goodie. Looks like what you're looking for. Adding Design-Time Support to ASP.NET Controls

    Here's a more recent article: Design-Time Attributes for Components