再会。
我在上一篇文章以及上一篇文章中都看过这里http://miniprofiler.com/ http://miniprofiler.com/但找不到任何有关如何使用的文档MiniProfiler.Settings.CustomUITemplates
.
我也看到了如何自定义 Mini-Profiler UI https://stackoverflow.com/questions/13108920/how-to-customize-the-mini-profiler-ui这不是所要求的。
我们的 MVC4 布局页面下面有一个调试部分,我想在页面底部的 div 中列出结果,而不是将其显示在弹出窗口中。
我发现您可以更改弹出窗口的位置,但我想在表格中显示结果。
你能指出我正确的方向吗?
代码如下:
/// <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; }
CustomUITemplates
允许您提供您自己的版本的任何文件用户界面项目 https://github.com/MiniProfiler/ui- 处理所有客户端操作的文件。
默认情况下是使用这些文件,因为它们包含在 .net 项目中(子模块包含在StackExchange.Profiling https://github.com/MiniProfiler/dotnet/tree/master/StackExchange.Profiling.ui。如果您在指定的文件夹中包含名称完全相同的文件CustomUITemplates
文件夹(默认为 ~/App_Data/MiniProfilerUI,但您可以根据需要将其更改为其他内容),然后它将使用这些文件。
在您的示例中,您想要更改在客户端呈现结果的位置。为此,您需要复制现有的include.js https://github.com/MiniProfiler/ui/blob/master/includes.js文件,将其放入模板文件夹中,然后更改其中的功能以将结果输出到页面中的表格,而不是内置功能(您可能希望首先查看修改按钮显示 https://github.com/MiniProfiler/ui/blob/a6248d7691ec5631ebe638347a884f33d06a67de/includes.js#L260include.js 中的函数并更改它以按照您想要的方式处理 json)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)