Display Attribute Description used as Tooltip

Nov 14, 2012 at 7:09 AM


As we are already using various display attributes for the controls would it be possible to use the Description attribute as a Tooltip for various controls

Many thanks


Nov 15, 2012 at 11:11 AM

You can do it by defining some Mvc Templates as explained in this series of post of Brad Wilson. So for instance if you want to use the tooltip in all TypedTextBox of a grid, you define a template based on the TypedTextBox, and use it in the grid instead of the simple TypedTextBox. In your template you read the description metadata and put it in the TypedTextBox as a tooltit by using its htmlAttributes parameter. The you can also use jQuery tooltips plugin to have a better user experience.