Hello, I'm building a registration page with MVC .NET and I'm having a hard time. I want to validate the information filled in, if they are correct, I will follow the flow of the application but if not, I want to open a modal jquery warning the user that there is incorrect information. Since I am new to MVC, I still have not been able to do this. I created the div with modal and called it through the click of the button, but I could not put this condition to open only when my post is unsuccessful.
Below is the div with the modal I created.
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<h4>ATENÇÃO!</h4>
<p>
Existem informações inconsistentes em seu cadastro.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Fechar</button>
</div>
</div>
</div>
</div>