Hello,
Inside my main layout page (_Layout), I render a partial view that is responsible for displaying messages that have been added by the controlled, through the Toastr javascript library.
Partial view code
@using Biblioteca.Util
@using Biblioteca.Util.Base.UI
@if (TempData.ContainsKey("Alerta"))
{
Alerta alerta = TempData["Alerta"] as Alerta;
@MensagemAlerta.MostrarMensagensAlerta(alerta);
}
When the methods of my pages are executed through POST in the form, the messages are displayed correctly, once the page is reloaded and consequently the partial view as well.
My problem is that in some methods I make the call via AJAX, updating just another partial view with the search result for example. In this scenario, because the partial view of messages is not reloaded, it is not displayed to the user. This occurs only when the user refreshes the page (F5).
My initial idea is to add in the "ajaxStop" event a code that causes the partial view of messages to be loaded again, but I'm not sure how to do that.
Control again with your help.