Solved

VB.NET/ASP.NET  Server Validation question

Posted on 2013-01-11
4
586 Views
Last Modified: 2013-01-11
Hello Experts,
Need some help:

Markup:

 <telerik:RadTextBox    ID="txtInventoryName" runat="server" TabIndex="1" MaxLength="10">
                                    </telerik:RadTextBox>
                                     &nbsp;<bonton:ToolTipValidator ID="valInventoryName" runat="server" ControlToEvaluate="txtInventoryName" />    



I am using this server side validation:

Private Sub valInventoryName_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles valInventoryName.ServerValidate
        Dim value As String = txtInventoryName.Text.Trim.ToUpper
        If String.IsNullOrEmpty(value) Then
            valInventoryName.ErrorMessage = "Inventory Name is required"
            args.IsValid = False
        End If
    End Sub

I want it to fire only on SAVE button click…it is firing on RETRIEVE button click … how to avoid the validation on RETRIEVE…


Thanks
0
Comment
Question by:mani_sai
  • 3
4 Comments
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 38768012
There should be some kind of validationmode.

You want to set that to manual.

From there in your save event call
valInventoryName.Validate()
0
 
LVL 8

Author Comment

by:mani_sai
ID: 38768034
RETRIEVE is preformed before SAVE.

the validation is firing on RETRIEVE... i want to avoid it.... any idea?


Thanks
0
 
LVL 8

Author Comment

by:mani_sai
ID: 38768082
got it.

CausesValidation="False"
0
 
LVL 8

Author Closing Comment

by:mani_sai
ID: 38768084
Thanks
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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

16 Experts available now in Live!

Get 1:1 Help Now