I' m desperate, nobody knows why this subroutine don' t check for an empty string in the text box 'activ2.Text' ? This sub is in an aspx page (asp.net vb.net).


My complete Subroutine:
Code:
Sub ServerVal_activ(sender As Object, value As ServerValidateEventArgs)

  Try

    Dim var1 As Integer
    var1 = activ1.SelectedItem.Value    
    Dim var2 As String
    var2 = activ2.Text  

       If (var1 = 7) And (var2 = "") Then
         value.IsValid = False
         Exit Sub

       End If

  Catch exc As Exception
  End Try

  value.IsValid = True

End Sub
This Sub is triggered by the follow ASP.NET Custom Validator:
Code:
<asp:CustomValidator id="CustomValidator1" runat="server" ControlToValidate="var2" OnServerValidate="ServerVal_activ" Display="Dynamic">You must specify the activity.
</asp:CustomValidator>
What is the problem?...


Thanks,
Cesar