VB.NET/ASP.NET Server Validation question

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
LVL 8
mani_saiAsked:
Who is Participating?
 
Kyle AbrahamsConnect With a Mentor Senior .Net DeveloperCommented:
There should be some kind of validationmode.

You want to set that to manual.

From there in your save event call
valInventoryName.Validate()
0
 
mani_saiAuthor Commented:
RETRIEVE is preformed before SAVE.

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


Thanks
0
 
mani_saiAuthor Commented:
got it.

CausesValidation="False"
0
 
mani_saiAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.