By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,501 Members | 1,678 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,501 IT Pros & Developers. It's quick & easy.

Issue with ValidationSummary Control, ErrorMessage and Text

P: n/a
I'm wanting to just show the error in a ValidationSummary control, not
next to the actual TextField I'm putting a RequiredFieldValidator next
to. I don't even want the little "*" showing which field it is.
(strange requirement, but that's the way it is).

I've found that if I set the attribute Text="" (zero length string),
it always uses the ErrorMessage instead of Text. I need the
ErrorMessage because that is what is going to show up in the
ValidationSummary control.

Any ideas how to force the text to blank right next to the control?

Thanks,
Peter Kellner
http://peterkellner.net
May 16 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Peter,

Does it do what you want if you set the validator to display="None" ?

Ken
Microsoft MVP [ASP.NET]

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:textbox id="TextBox2" runat="server"></asp:textbox>
<asp:requiredfieldvalidator id="RequiredFieldValidator1"
runat="server" controltovalidate="TextBox1" display="None"
errormessage="RequiredFieldValidator"></asp:requiredfieldvalidator><br />
<br />
<asp:textbox id="TextBox1" runat="server"></asp:textbox>
<asp:requiredfieldvalidator id="RequiredFieldValidator2"
runat="server" controltovalidate="TextBox2"
errormessage="RequiredFieldValidator"></asp:requiredfieldvalidator><br />
<br />
<asp:validationsummary id="ValidationSummary1" runat="server" />
<br />
<br />
<asp:button id="Button1" runat="server" text="Button" /></div>
</form>
</body>
</html>
"PeterKellner" <pk**********@73rdstreet.com> wrote in message
news:ap********************************@4ax.com...
I'm wanting to just show the error in a ValidationSummary control, not
next to the actual TextField I'm putting a RequiredFieldValidator next
to. I don't even want the little "*" showing which field it is.
(strange requirement, but that's the way it is).

I've found that if I set the attribute Text="" (zero length string),
it always uses the ErrorMessage instead of Text. I need the
ErrorMessage because that is what is going to show up in the
ValidationSummary control.

Any ideas how to force the text to blank right next to the control?

Thanks,
Peter Kellner
http://peterkellner.net

May 16 '06 #2

P: n/a
On Tue, 16 May 2006 19:10:05 -0400, "Ken Cox [Microsoft MVP]"
<BA**********@hotmail.com> wrote:
Hi Peter,

Does it do what you want if you set the validator to display="None" ?

Ken
Microsoft MVP [ASP.NET]


Yes it does. And, Thank you Ken.
Peter Kellner
http://peterkellner.net
May 16 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.