How to use MiniProfiler.Settings.CustomUITemplates

Good day.

I have looked here for the previous post as well as http://miniprofiler.com/ but cant find any documentation on how to use MiniProfiler.Settings.CustomUITemplates

.

I've also seen How to Customize the Mini-Profiler UI which is not required.

We have a debug section below on our MVC4 layout page, and I would like to list the results in a div at the bottom of the page, rather than display it in a popup.

I see that you can change the position of the popup, but I would like to show the results in a table.

Could you please point me in the right direction.

The code looks like this:

  /// <summary>
  /// The path where custom ui elements are stored.
  ///             If the custom file doesn't exist, the standard resource is used.
  ///             This setting should be in APP RELATIVE FORM, e.g. "~/App_Data/MiniProfilerUI"
  /// 
  /// </summary>
  /// 
  /// <remarks>
  /// A web server restart is required to reload new files.
  /// </remarks>
  [DefaultValue("~/App_Data/MiniProfilerUI")]
  public static string CustomUITemplates { get; set; }

      

+2


source to share


1 answer


CustomUITemplates

allows you to provide your own version of any of the files that are part of the project - files that handle all client-side operations.

By default, these files are used because they are included in the .net project (a submodule included in StackExchange.Profiling .ui. If you include files with the same name in the folder specified as the folder CustomUITemplates

(defaults to ~ / App_Data / MiniProfilerUI, but you you can change it to something else if you like), then it will use those files.



In your example, you want to change the location where the results are displayed on the client side. To do this, you need to copy the existing include.js file , place it in your templates folder, and then modify the functionality there to output the results to a table on your page, rather than the inline functions (you can start by looking at modifying the buttonShow function in include.js and change it to process the json the way you would like).

+1


source







All Articles