开发者

How to set width of a custom validator

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 开发者_StackOverflowwidths that are set.

Thanks for any insight.

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


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜