Solved

How can you clear all Validation Errors?

Posted on 2010-11-23
3
1,293 Views
Last Modified: 2012-05-10
I have several properties that require some validation on my Silverlight application.

I also have a reset button that I would like the user to click and clear all validation errors.

What's the best approach?

The following shows a simple property that gets validated:
    <Display(Name:="Title")> _
    <Required(ErrorMessage:="The Title field is required.")> _
    Public Property Title() As String
        Get
            Return siteTitle
        End Get
        Set(ByVal Value As String)
            'If String.IsNullOrEmpty(Value) = True Then
            '    Throw (New Exception("The Title field is require."))
            'End If

            Validator.ValidateProperty(Value, New ValidationContext(Me, Nothing, Nothing) With {.MemberName = "Title"})

            siteTitle = Value
        End Set
    End Property

Open in new window

0
Comment
Question by:dev_ven
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 34199627
Are you using a validation summary? Use the

ValidationSummary.Errors.Clear() method.
0
 

Author Comment

by:dev_ven
ID: 34199695
I just have it where the tooltip appears to the side of the textbox.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question