Click here to Skip to main content
13,043,898 members (57,436 online)
Rate this:
Please Sign up or sign in to vote.
See more:
how to check validation group ?
i have a form in which 50 textbox whin i click button then this page validate false how to check which textbox is blank in validation group.

Imports Microsoft.VisualBasic
Imports System.Data.SqlClient
Imports .DBUtility
Imports System.Collections.Generic

Public Function getColorCode(ByVal obj As CColorName, ByVal startIndex As Int16, _
                            ByVal endIndex As Int16, ByRef totalRecords As Int16, ByVal TRecords As Boolean, ByVal strCheckColorList As String)As List(Of CColorName)
        Dim objlst As New List(Of CColorName)()
        Dim reader As SqlDataReader
            If TRecords = True Then
                Dim param As SqlParameter() = New SqlParameter() {New SqlParameter("@ColorID", obj.ColorID), _                                                                                                                                   
                                                                  New SqlParameter("@Color", strCheckColorList) }
                reader = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringRage_RMS, Data.CommandType.StoredProcedure, "dbo.vs_Color_SELECT_TR", param)
                If (reader.Read) Then
                    totalRecords = reader(0)
                End If
                Dim sqlParams As SqlParameter() = New SqlParameter() {New SqlParameter("@ColorId", obj.ColorId), _                                                                      
                                                                      New SqlParameter("@Color", strCheckColorList), _                                                                   
                                                                      New SqlParameter("@startIndex", startIndex), _
                                                                      New SqlParameter("@endIndex", IIf(endIndex = 0, Integer.MaxValue, endIndex))}
                reader = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringRage_RMS, Data.CommandType.StoredProcedure, "dbo.vs_Color_SELECT_PAGING", sqlParams)
                Dim sqlParam As SqlParameter() = New SqlParameter() {New SqlParameter("@ColorID", obj.ColorId), _                                                                  
                                                                      New SqlParameter("@Color", strCheckColorList)}
                reader = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringRage_RMS, Data.CommandType.StoredProcedure, "dbo.vs_Color_SELECT", sqlParam)
            End If
            While reader.Read
                Dim objC As New CColorName
                If Not IsDBNull(reader("CModelID")) Then objC.ModelID = reader("CModelID")
            End While
            Return objlst
        Catch ex As Exception
            Logs.WriteErrorLog("DBColor.vb | getColorCode " + ex.Message)
            Return objlst
            objlst = Nothing
            reader = Nothing
        End Try
    End Function
Posted 25-Sep-12 23:54pm
Updated 1-Oct-12 1:28am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The validation groups help you to group the controls in a single page. Following examples will help you implement that:[^][^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Hello Dinesh,

You can use below snipet to validate which validation is pfailed

this.Validators.Where(v => !v.IsValid

Please let us know if any.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

set should set validationGroup Property same for all textbox and button .
Rate this: bad
Please Sign up or sign in to vote.

Solution 4


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 1 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100