.NETGURU
Controling Validator.ErrorMessage
Messages   Related Types
This message was discovered on ASPFriends.com 'aspng-validators' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Scott Cate
My Req. Field Validator Error Messages show up on the page load. I would
like them to show up only after the field Lost Focus.

I have the .Display mode = ValidatorDislay.Dynamic so after the cursor
leaves the field, the message stays or goes away appropriately, but I
want it to only show up if a mistake is made.

The CompareValidator works like this, by default I guess because I
haven't done anything specific.

Thanks for your ideas.

Scott

Reply to this message...
 
    
Steven A Smith (VIP)
This shouldn't happen, so I'm going to assume there is a bug in your code
somewhere. Can you post the failing page?

Steve

----- Original Message -----
From: "Scott Cate" <Click here to reveal e-mail address>
To: "aspng-validators" <Click here to reveal e-mail address>
Sent: Tuesday, April 02, 2002 12:58 AM
Subject: [aspng-validators] Controling Validator.ErrorMessage

[Original message clipped]

Reply to this message...
 
    
Scott Cate
Here's the code Steve:

Dim Row As New TableRow()
Dim DescCell As New TableCell()
DescCell.CssClass = "kbmainfontlabels"
DescCell.VerticalAlign = VerticalAlign.Top
DescCell.Text = Desc
Dim EditCell As New TableCell()
EditCell.VerticalAlign = VerticalAlign.Top
'tbName is the name of the TextBox Control that gets added, and
bound to rfv,cv
EditCell.Controls.Add(CreateTextBox(tbName, tbValue, 40,
ControlEnabled))
Dim rfv As New RequiredFieldValidator()
With rfv
.ControlToValidate = tbName
.ErrorMessage += "<BR>User Name is a Required Field"
.Display = ValidatorDisplay.Dynamic
.Enabled = True
End With
EditCell.Controls.Add(rfv)
Dim cv As New CompareValidator()
With cv
.ErrorMessage += "<BR>[Admin] Username is Protected and can
not be reused"
.ControlToValidate = tbName
.Operator = ValidationCompareOperator.NotEqual
.ValueToCompare = "admin"
.Type = ValidationDataType.String
.Display = ValidatorDisplay.Dynamic
.Enabled = True
.EnableViewState = True
End With
EditCell.Controls.Add(cv)
Row.Cells.Add(DescCell)
Row.Cells.Add(EditCell)
Return Row

Scott Cate
Account Executive
t. (800) 996-myKB
f. (419) 793-4946

Click here to reveal e-mail address

myKB.com
6210 E. Thomas #100
Scottsdale, AZ 85251    

-----Original Message-----
From: Steven A Smith [mailto:Click here to reveal e-mail address]
Sent: Monday, April 01, 2002 11:21 PM
To: aspng-validators
Subject: [aspng-validators] Re: Controling Validator.ErrorMessage

This shouldn't happen, so I'm going to assume there is a bug in your
code somewhere. Can you post the failing page?

Steve

----- Original Message -----
From: "Scott Cate" <Click here to reveal e-mail address>
To: "aspng-validators" <Click here to reveal e-mail address>
Sent: Tuesday, April 02, 2002 12:58 AM
Subject: [aspng-validators] Controling Validator.ErrorMessage

[Original message clipped]

| [aspng-validators] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT

Reply to this message...
 
 
System.Web.UI.MobileControls.CompareValidator
System.Web.UI.MobileControls.RequiredFieldValidator
System.Web.UI.MobileControls.TextBox
System.Web.UI.WebControls.CompareValidator
System.Web.UI.WebControls.RequiredFieldValidator
System.Web.UI.WebControls.TableCell
System.Web.UI.WebControls.TableRow
System.Web.UI.WebControls.TextBox
System.Web.UI.WebControls.ValidationCompareOperator
System.Web.UI.WebControls.ValidationDataType
System.Web.UI.WebControls.ValidatorDisplay
System.Web.UI.WebControls.VerticalAlign
System.Windows.Forms.TextBox




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification