0
Hello,
Within my main layout page (_Layout), I address a partial view that is responsible for displaying messages that have been added by the controlled, through the Toastr javascript library.
Code of partial view
@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 also.
My problem is that in some methods I make the call via AJAX, updating only another partial view with the result of the search for example. In this scenario, as the partial message view 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 event "ajaxStop" a chunk that code that causes the partial message view to be loaded again, but I’m not sure how to do this.
I fight again with your help.