Tags Ok In Text of Validator Control?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Tags Ok In Text of Validator Control?

    Is this ok? I haven't seen any examples of it, but it looks like it should
    work:


    <asp:requiredfieldvalidator id="valreqUserName" runat="server"
    controltovalidate="txtUserName"
    errormessage="Please enter the user name">
    <span title="Please enter the user name">
    <img src="../../images/bullet.gif">
    </span>
    </asp:requiredfieldvalidator>
    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]


    John Saunders Guest

  2. Similar Questions and Discussions

    1. Validator for server control inside user control
      Hello, I am facing a strange situation and have already spent a lot of time on this. I have a user control 'U' that consists of a...
    2. Attaching a validator to a composite control
      I would like to have my control provide a Required property, and if this property is true, attach a RequiredFieldValidator. This approach works...
    3. Adding Validator Control at runtime in a Custom Control
      Hi Wim, How do we link the TextBox to this validator control class in runtime ? Could you please tell. Thanks _ Muds. Wim Hollebrandse...
    4. Possible to create a composite control that has a child control that is a validator that validates the composite control itself?
      I am attempting to create a composite control which has a label, followed by an optional error message, followed by two text boxes. I have...
    5. Validator and custom control question
      Hello, I have a custom control that overrides the base class render method. From the Render method I got a call to the follwing method in the...
  3. #2

    Default RE: Tags Ok In Text of Validator Control?

    Hi John,

    You are right. It's possible to display error using inline error message or
    client element.

    As an alternative to using the Error Message property for the control, you
    can display an error for the control by simply writing it between the open
    and close tags for the Validation control. However, unlike the error
    Message property, which only supports text-based errors, an inline error
    message can contain other client side elements, such as images. Here is a
    sample for your reference:

    <input type =text id="TextFirstname" value ="Enter First Name" runat
    =server >

    <asp:RequiredFieldValidator
    id="RequiredFieldValidator1"
    style="Z-INDEX: 103; LEFT: 248px; POSITION: absolute; TOP: 56px"
    ControlToValidate="TextFirstname"
    InitialValue="Enter First Name"
    display="Dynamic"
    runat="server">

    <img src="http://localhost/1.jpg">

    </asp:RequiredFieldValidator>

    I hope this helps.

    Best Regards,
    Lewis Wang
    Support Professional

    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
    | From: "John Saunders" <john.saunders@surfcontrol.com>
    | Subject: Tags Ok In Text of Validator Control?
    | Date: Wed, 23 Jul 2003 14:13:27 -0400
    | Lines: 17
    | Organization: SurfControl, Inc.
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    | Message-ID: <uJ6rZYUUDHA.2196@TK2MSFTNGP11.phx.gbl>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: host254wb.surfcontrol.com 65.194.40.254
    | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
    | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:161469
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Is this ok? I haven't seen any examples of it, but it looks like it should
    | work:
    |
    |
    | <asp:requiredfieldvalidator id="valreqUserName" runat="server"
    | controltovalidate="txtUserName"
    | errormessage="Please enter the user name">
    | <span title="Please enter the user name">
    | <img src="../../images/bullet.gif">
    | </span>
    | </asp:requiredfieldvalidator>
    | --
    | John Saunders
    | Internet Engineer
    | [email]john.saunders@surfcontrol.com[/email]
    |
    |
    |

    Lewis Wang [MSFT] Guest

  4. #3

    Default RE: Tags Ok In Text of Validator Control?

    Thanks, Lewis. I can see I'll be using this in the future.

    I may even create my own derived validator controls, overriding the
    ErrorMessage property and adding an ErrorImageUrl property. This would
    save me re-typing the error message.

    Thanks,
    John Saunders
    [email]john.saunders@surfcontrol.com[/email]

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    John Saunders Guest

  5. #4

    Default RE: Tags Ok In Text of Validator Control?

    Hi John ,

    Good idea!
    Thanks very much for participating the community.

    Lewis Wang
    Support Professional

    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
    | From: John Saunders <john.saunders@surfcontrol.com>
    | References: <5E0F3ZcUDHA.1688@cpmsftngxa06.phx.gbl>
    | X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
    | Subject: RE: Tags Ok In Text of Validator Control?
    | Mime-Version: 1.0
    | Content-Type: text/plain; charset="us-ascii"
    | Content-Transfer-Encoding: 7bit
    | Message-ID: <u3hZK8dUDHA.1004@TK2MSFTNGP12.phx.gbl>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | Date: Thu, 24 Jul 2003 05:28:07 -0700
    | NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
    | Lines: 1
    | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
    | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:161705
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Thanks, Lewis. I can see I'll be using this in the future.
    |
    | I may even create my own derived validator controls, overriding the
    | ErrorMessage property and adding an ErrorImageUrl property. This would
    | save me re-typing the error message.
    |
    | Thanks,
    | John Saunders
    | [email]john.saunders@surfcontrol.com[/email]
    |
    | *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    | Don't just participate in USENET...get rewarded for it!
    |

    Lewis Wang [MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139