0
I am using the bootbox in my application and would like to know how to change the default name of Alert that is as OK, below my script:
@section Scripts{
<script src="~/Scripts/bootbox.min.js"></script>
<script>
$(document).ready(function () {
$.getJSON('@Url.Action("Ajax_Teste")', function (response) {
alert("getJson sucesso");
}).fail(function (data) {
bootbox.alert("Não foi possível processar a sua requisição. abra o log para consulta" + data.responseJSON.msg);
});
});
</script>
}
Actually Leandro the ok button will become SEND ERROR REPORT, in which it will capture my error log and send to my email. And when I used this example then Alert is no longer being shown!!!
– WPfan
so you need a callback, I would recommend changing Alert to confirm or prompt... so the user has the option to submit the report or simply close. Note: if the user will always send the report, you do not need to do this second post in the client... just send in the action that returns the error.
– Leandro Angelo
As I do not understand very well, could give an answer showing how to do by prompt, and yes, always the user will send to email!
– WPfan
But if you always want to receive the report, if it has not captured anything that is on the user screen, it makes no sense to give this action/option to it. As I said, send the report in the backend, after all you already captured the error and here would just be showing to the user.
– Leandro Angelo
In this situation, man, there’s always gonna be something captured. That’s why I need to do this, because you’re only in that condition if you have something captured, you understand? Show me inside my context what this prompt would look like, because I never did it!
– WPfan
I added the
confirm
, but I say captured from the DOM being displayed... pq the error message you show comes from the server– Leandro Angelo
Leandro, worked perfectly now I did not understand what to do with callback, there I must enter the SMTP settings for sending to the email???
– WPfan
No, you cannot send emails by javascript, you will have to create an Action in your controller, make a post for it and send by Asp.net... and now you will understand why from the other question I said you should send the error at the time of capture... : P
– Leandro Angelo