1
I have the following functions on my page, when I call them via javascript, they work perfectly:
function msgSucesso(msg) {
toastr.success(msg);
}
function msgErro(msg) {
toastr.error(msg);
}
Hence, I have a button on my aspx page that calls a server event:
<asp:Button ID="btnSalvar" runat="server" OnClick="btnSalvar_Click" Text="Salvar" />
In the cobehind:
protected void btnSalvar_Click(object sender, EventArgs e)
{
try
{
// código para salvar
}
catch (Exception ex)
{
// erro
}
}
I’d like to call in the duties msgSucesso
or msgErro
when everything goes right or when it goes wrong, respectively, when running the server event. How to do this? I know it’s easy, but I’m used to ASP.NET MVC which is quite different.
It worked, it worked. Thank you.
– Gabriel L