ok yo agrege un required validator en mi ventana y me funciona bien siempre y cuando deje un campo en blanco y le haga clic a un boton pero tengo el caso que en esa ventana no tengo ningun boton si un dropdown que al hacer el change carga un gridview. Lo que deseo hacer es invocar el required validator cuando el campo txt este en blanco despues que el dropdown hace el change, en estos momentos lo controlo por label pero lo quiero hacer con el ajax.
code behind
Código:
If DDL_Tipo_Cierre.SelectedValue = 3 Then
txt_calendar.Visible = True
If txt_calendar.Text = "" Then
txt_calendar.BackColor = Drawing.Color.Red
txt_calendar.Text = "Fecha es Requerida"
actualizar2.Visible = True
Else
txt_calendar.BackColor = Drawing.Color.White
Dim Cmd_Solucionadas As OleDbCommand = New OleDbCommand("SISE.SP_HP_CARGAR_CONSULTA_MESA_CERRADA_SOLUCIONADA", conn)
Cmd_Solucionadas.CommandType = Data.CommandType.StoredProcedure
conn.Open()
Dim Par_Id_GrupoSol As OleDbParameter = Cmd_Solucionadas.Parameters.Add("PAR_ID_GRUPO", OleDbType.Integer)
Par_Id_GrupoSol.Value = Par_Id_Grupo
Dim Par_DptoSol As OleDbParameter = Cmd_Solucionadas.Parameters.Add("PAR_DPTO", OleDbType.VarChar)
Par_DptoSol.Value = Par_Departamento
Dim Par_UsuarioSol As OleDbParameter = Cmd_Solucionadas.Parameters.Add("PAR_USUARIO", OleDbType.VarChar)
Par_UsuarioSol.Value = Par_UsuarioLog
Dim fechasel As OleDbParameter = Cmd_Solucionadas.Parameters.Add("fecha", OleDbType.DBDate)
fechasel.Value = txt_calendar.Text
'Dim Par_SesionRec As OleDbParameter = Cmd_Solucionadas.Parameters.Add("PAR_PSS", OleDbType.Integer)
'Par_SesionRec.Value = Me.Txt_Sesion.Text
Dim adpt_Solucionadas As New OleDbDataAdapter(Cmd_Solucionadas)
Dim ds_Solucionadas As New DataSet
adpt_Solucionadas.Fill(ds_Solucionadas, "T_Solucionadas")
GV_Mis_Pendientes.DataSource = ds_Solucionadas
GV_Mis_Pendientes.DataBind()
conn.Close()
End If
End If