Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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
        Try
            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)
            Else
                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")
              objlst.Add(objC)
            End While
            Return objlst
        Catch ex As Exception
            Logs.WriteErrorLog("DBColor.vb | getColorCode " + ex.Message)
            Return objlst
        Finally
            objlst = Nothing
            reader = Nothing
        End Try
 
    End Function
Posted 26-Sep-12 0:54am
Edited 1-Oct-12 2:28am
v2
Rate this: bad
good
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:
http://msdn.microsoft.com/en-us/library/ms227424(v=vs.100).aspx[^]
http://www.dotnet-guide.com/validationgroups.html[^]
  Permalink  
Rate this: bad
good
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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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

Solution 4

hi

To know about validation group refer this link
http://www.w3schools.com/aspnet/prop_webcontrol_imagebutton_validationgroup.asp[^]
 
and example to check which textbox is blank
 
[]http://www.w3schools.com/aspnet/showasp.asp?filename=demo_prop_webcontrol_imagebutton_validationgroup[^]
 
happy coding...
  Permalink  

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

  Print Answers RSS
0 Maciej Los 205
1 Richard MacCutchan 185
2 DamithSL 170
3 Tomas Takac 146
4 OriginalGriff 132
0 OriginalGriff 5,130
1 DamithSL 4,237
2 Maciej Los 3,700
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,846


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 1 Oct 2012
Copyright © CodeProject, 1999-2014
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