Domanda

I am implementing some custom Glimpse Tabs to show advanced statistics from our framework. So far that works great. The problem I could not fix so far is, that the tab content does not get updated after AJAX calls. In the debugger I see that GetData() gets called and returns the up to date stats but the Glimpse UI is still showing the old tab content.

Here is the simplest of my pages returning a plain object with a few prop in it (database command counter, etc. - nothing fancy).

public class GlimpseTabOverview : TabBase
{
    public override string Name
    {
        get { return "Overview"; }
    }

    public override object GetData(ITabContext context)
    {
        if (context == null) { throw new ArgumentNullException("context"); }
        return WebStatisticsHelper.GetBasicStatsData();
    }
}

Refreshing the whole page does show the new values but not when doing Ajax. I took a look (or two) at the Glimpse source but could not yet find what could cause that.

We use ASP.Net MVC 5.1 with IIS-Express and the latest Glimpse and Glimpse.AspMvc5.

Does anybody have an idea why the Glimpse UI does not take the new data?

È stato utile?

Soluzione

Are you selecting the Ajax request that occurred from the Ajax tab? The Glimpse context doesn't just change when an Ajax call occurs. Since these calls could happen very quickly or when you are trying to read the data of the origin request, we leave it up to you to decide when you view the ajax requests Glimpse data. To do this, simply go to the Ajax tab and when the request appears, select that request and view the relevant tab. Let em know if that fixes the issue you are having.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top