Keeping Required Field Validators quiet when using a Summary - Jon Galloway

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.

Published Saturday, September 27, 2003 10:50 PM by Jon Galloway
Filed under:

Comments

# re: Keeping Required Field Validators quiet when using a Summary

Thanks..

It's true that <NOBR> tag isn't used very often, but it's pretty handy & it worked fine for me in IE and FF browsers.

Wednesday, September 24, 2008 1:10 AM by ruckfules

# re: Keeping Required Field Validators quiet when using a Summary

You could simply set Display="none" attribute on the rfv.

Thursday, May 05, 2011 1:12 PM by Greg