Solved

How can you clear all Validation Errors?

Posted on 2010-11-23
3
1,244 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
  • 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
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34199734
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now