473,289 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Issue with ValidationSummary Control, ErrorMessage and Text

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
2 1854
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Mabbott | last post by:
Hello all, We're getting some weird behavior with the ValidationSummary control. If I submit a page that fires some validators, the ValidationSummary displays them correctly. However, if I...
1
by: mg | last post by:
Is there a way to include in a ValidationSummary an error message that says that an exception was thrown or that an if/else test went to 'else' ?
3
by: Mike | last post by:
Is there a way to reference the value of a validationsummary control? I have a need to display any validation errors on my pages in a unique way and the normal output of the validationsummary...
4
by: andersoj | last post by:
I have a page that has some required field validators created in the aspx, and other validators created in the Page_Load event. In IE, all validation works as expected. In Firefox, ASPX...
2
by: c676228 | last post by:
Hi, I have several user controls like email, phone,ssn etc. each has it's own validation message in its user control already. When I bring all those user controls in an aspx page, I would like to...
0
by: MattB | last post by:
I have a (asp.net 1.1) page that loads a bunch of user controls based on some database data. The User Controls have input controls and associated validators on them, and I wanted to place a...
0
by: Stephen | last post by:
I have a ValidationSummary tag in an aspx page: <asp:ValidationSummary ID="ErrorSummary" ShowSummary="true" DisplayMode="BulletList" HeaderText="Please review the following errors:" runat="server"...
2
by: Code Rodent | last post by:
Hi there, Please please could someone shed some like on a problem that I'm having using a combination of Wizards, ValidationGroups and ValidationSummary controls. What I want to do is to have a...
0
by: Code Rodent | last post by:
Hi there, Please please could someone shed some like on a problem that I'm having using a combination of Wizards, ValidationGroups and ValidationSummary controls. What I want to do is to have a...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.