468,133 Members | 1,250 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

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
jo***********@surfcontrol.com
Nov 17 '05 #1
5 1587
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" <jo***********@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: <uJ**************@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
| jo***********@surfcontrol.com
|
|
|

Nov 17 '05 #2
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
jo***********@surfcontrol.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
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 <jo***********@surfcontrol.com>
| References: <5E**************@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: <u3**************@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
| jo***********@surfcontrol.com
|
| *** Sent via Developersdex http://www.developersdex.com ***
| Don't just participate in USENET...get rewarded for it!
|

Nov 17 '05 #4
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
jo***********@surfcontrol.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #5
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 <jo***********@surfcontrol.com>
| References: <5E**************@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: <u3**************@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
| jo***********@surfcontrol.com
|
| *** Sent via Developersdex http://www.developersdex.com ***
| Don't just participate in USENET...get rewarded for it!
|

Nov 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Barney Norris | last post: by
21 posts views Thread by Zenobia | last post: by
30 posts views Thread by Toni Mcintyre | last post: by
12 posts views Thread by Stefan Weiss | last post: by
4 posts views Thread by Rakesh | last post: by
9 posts views Thread by Alex Shirley | last post: by
8 posts views Thread by Mark | last post: by
27 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.