Keeping Required Field Validators quiet when using a Summary

If you've got RFV's in a datagrid (or on other special occasions) you may want their error messages to only show up on the Validator Summary. If you don't have any text set for a validator, it displays the entire error message.

One trick to keep them from displaying (and messing up the formatting) is to give them harmless (no space) html tags to display. "<NOBR></NOBR>" works well, or you could just as easily use "<I></I>". The <NOBR> tag isn't used very often, but it's pretty handy - especially with webforms where it's tougher to position everything since .NET is writing most of the HTML. Anything inside a <NOBR></NOBR>block will stay on one line if possible.

2 Comments

Comments have been disabled for this content.