Requiredfieldvalidator not validating
Get Literal("Dim my Text Box = New Text Box() my Text Box. Add(my Text Box) Dim validator = New Required Field Validator() validator. I have a simple form with a required Validator on a textbox.When I leave the textbox blank and check the Valid it is always true.The issue in my case turned out to be related to the ASP.
Since the initial value of the validator is not an empty string, it treats an empty string as a valid input.
Validation can occur on the client if available, or on the server. Inner Writer = writer End Sub Public Overrides Sub Write Attribute(By Val name As String, By Val value As String, By Val f Encode As Boolean) Dim Context As Http Context = Http Context.
The job of the validator isn't to prevent a postback, it's to validate the input. Current 'Skip the action attribute of the form control. Items("Action Already Written") Is Nothing Then My Base.
I have a question about what could stop a Required Field Validator from preventing a postback.
I began working on an older, but simple aspx form and my predecessor used manual, server-side form validation (checking to see if some form fields have a value and if not displaying an error message in a label).