CustomValidator + Tooltip = Mysterious Linebreak

Last post 03-30-2007 3:13 PM by MaritimeGirl. 0 replies.

Sort Posts:

  • CustomValidator + Tooltip = Mysterious Linebreak

    03-30-2007, 3:13 PM

    I have a CustomValidator where I set the tooltip equal to my errormessage when invalid and text="*".  This works correctly, however when .NET renders the span, it wraps the HTML onto a new line in the middle of the title attribute value, thereby causing the tooltip to also wrap where it isn't supposed to.

    The rendered HTML appears like this...

    <span id="mySpan" title="The
    error message displays correctly, however it inserts an extra break instead of performing normal wrapping for the tooltip.">
    *</span>

    It doesn't happen to all of my validators. but it does to some.  The error message does not contain any break in the text.

    I've tried rearranging the order of my CustomValidator's attributes - no change in how it is rendered.

    I've tried overriding the Render of the CustomValidator control with

    MyBase.RenderBeginTag(Writer)
    Writer.write(vbCrLF)
    MyBase.RenderContents(Writer)
    MyBase.RenderEndTag(Writer)

    but that didn't work either and caused all of my validators to display the Text value when first rendered, not just when invalid after a postback.

     

    Has anyone else encountered this?  Does anyone have a suggestion how to fix it?  We don't want random linebreaks in the tooltips to appear whenever .NET renders the spans with a break in the HTML source.

Page 1 of 1 (1 items)
Microsoft Communities
Page view counter