Solved

VB.NET/ASP.NET  Server Validation question

Posted on 2013-01-11
4
585 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 39

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 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

12 Experts available now in Live!

Get 1:1 Help Now