views:

23

answers:

2

Hey,

Does anybody know of a way to set the width of a custom validtor so that the error message text will wrap if it exceeds the specified width?

I have a user control that contains a custom validator which the containing page can set the error message on based on specific validation results.

The user control sits within a table cell in a page.

If the message is very long it simply prints the entire message on a single line ignoring any column widths that are set.

Thanks for any insight.

EDIT: I have tried setting the width property on the custom validator itself to no avail.

+1  A: 

Put it inside another element you can control the style of... like it's own div with a class you specify.

Bryan
A: 

If the user control is defined such that the error message appears inside a div, try to set the width of that div element.

If your control is in something like this

<asp:TableCell id="some1" runat="server">
    <uc:yourControl id="uc1" runat="server" />
</asp:TableCell>

Modify the control to have a div or span element for the message.

Rajeshwaran S P