0
In the user registration process I want to validate your CPF by Javascript and return if it is valid or not in beckend. And so make a if
with this result to insert it into the database or not.
if (ValidaCpf(txtCpf.Text) == False){
//retorna um erro
}
else{
//cadastra o usuário
}
Note: I already have the function of validating the CPF and the method of Inserting the User in the BD. I just need to pass the result of the validation of Javascript to the C#.
Leave more information. Does this come from a form? How it is created?
– Francisco
You should not rely on javascript validation, you should always revalidate all data on the server, a malicious user can circumvent their javascript validations and send what they want to the server.
– Leandro Godoy Rosa