News


ASP.NET Control Template Properties

Dino Esposito has another awesome article on MSDN.  This one is on setting up user controls on ASP.NET with template properties.

From the introduction:

Several controls include properties to set with text and values that display through the control's user interface (UI). The typical example is the Caption property of a GridView control; you set the text and the control renders it out on top of the grid. Such a property doesn't offer a great deal of flexibility, because all that it can do is show a static text. The passed value can be made more context-specific through dynamic formatting or perhaps data binding. Rest assured that the control layout that hosts the property value is fixed and immutable.

How can you design control properties that not just display context-specific information (i.e., data-bound information) but also support user-defined layouts? In ASP.NET, these properties are quite common and are implemented through templates. A template is a way to specify a custom user interface layout for certain graphical parts of the control.

He as a basic sample that’s a login control with some “extra” features, like a password reminder link, and a “Remember Me” check box.  The extra features can be turned on and off via his template properties.

UPDATE: For some reason the link to the article keeps disappearing:  It's here.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
Tuesday, April 18, 2006 5:34 PM

Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: