Hi,
I have an aspx page developed in Visual Studio 2003, which has a validate function which returns true/false
When a user wants to add an entry to the database, I call the validate function, set labels to red on textboxes/listboxes/dropdownlists that have not been properly populated or selected and produce a client side alert to let the user know that there is a problem with the fields entered
This works fine, however, after changing all the fields back to correct values, and I click the button again, it displays the alert again and doesnt go into the ValidateReportEntry() function to check that the fields are valid.
I suspect that the page isnt being refreshed properly and the client side script is being run over and over again
How do I remove it? or Force the page to be rebuilt without the client side script?
Thanks
Quanita
I have an aspx page developed in Visual Studio 2003, which has a validate function which returns true/false
When a user wants to add an entry to the database, I call the validate function, set labels to red on textboxes/listboxes/dropdownlists that have not been properly populated or selected and produce a client side alert to let the user know that there is a problem with the fields entered
Code:
Private Sub btnCreateReportEntry_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreateReportEntry.Click
If ValidateReportEntry() = False Then
RegisterClientScriptBlock("showCreateReportMessage", "<script language=""JavaScript""> alert('You need to rectify all fields in Red before adding a Report Entry!'); </script>")
Else
'code to insert into db here
End If
End Sub
This works fine, however, after changing all the fields back to correct values, and I click the button again, it displays the alert again and doesnt go into the ValidateReportEntry() function to check that the fields are valid.
I suspect that the page isnt being refreshed properly and the client side script is being run over and over again
How do I remove it? or Force the page to be rebuilt without the client side script?
Thanks
Quanita