mishrsud / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

AJAX Calls via Ext.NET Framework (http://www.ext.net) do not register #65

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run an Ext.NET based application
2. Perform an action that causes an Ajax call to the server

What is the expected output? What do you see instead?
I would expect to see a new profiler box with the timings for the AJAX call in 
it, but it seems nothing happens.

What version of the product are you using? On what operating system?
Ext.NET 1.0 on Windows XP.

Please provide any additional information below.
I have actually got this working, but I needed to change your source code for 
"includes.js" a bit.  Basically I had to expose the "fetchResults" method 
because I needed to call it myself.  So in "includes.js" on around line 425 I 
added the following:

fetchResultsExposed: function (ids) {
   return fetchResults (ids);
}

Then, in my ASPX master page, I added this (which is specific to the Ext.NET 
framework):

(C# code in the code behind):
//Ensure that when Ext.NET does an ajax request, we can perform some action 
//such as display MVC-Mini-Profiler results for the AJAX call
X.ResourceManager.Listeners.AjaxRequestComplete.Fn = "extAjaxComplete";

(ASPX code):
function extAjaxComplete(conn, req, options) {
    if (conn) {
        var stringIds = conn.getResponseHeader('X-MiniProfiler-Ids');
        if (stringIds) {
            var ids = typeof JSON != 'undefined' ? JSON.parse(stringIds) : eval(stringIds);
            alert(ids);
            MiniProfiler.fetchResultsExposed(ids);
        }
    }
}

------------
So you can see what I have done is mimic what you are doing for other AJAX 
calls so that it works for this particular framework.

I was wondering if you could incorporate my change to make "fetchResults" 
accessible via my application to cater for this?

Original issue reported on code.google.com by noo...@gmail.com on 24 Jul 2011 at 11:03

GoogleCodeExporter commented 8 years ago
Sorry I did not mean to log this as a "defect", it's more a feature enhancement 
to get the "fetchResults" method made accessible.

Original comment by noo...@gmail.com on 25 Jul 2011 at 2:01

GoogleCodeExporter commented 8 years ago
I've had to apply a similar patch to enable updates for Google Closure Library 
XHR requests. It would definitely be useful to have this exposed. I've attached 
a patch with OP's approach.

Original comment by dereksla...@gmail.com on 11 Aug 2011 at 9:15

Attachments:

GoogleCodeExporter commented 8 years ago
added the patch ... 

Original comment by sam.saff...@gmail.com on 26 Aug 2011 at 2:48