asp.net - 为什么 ASP.NET 控件树跟踪中存在大量 LiteralControl?

标签 asp.net webforms trace

我已经在 ASP.NET WebForms 中创建了一个基本页面,我想知道为什么 ASP.NET 跟踪中出现大量文字控件。这是一张图片。

谢谢。

enter image description here

最佳答案

所有文本都会变成 Literals由编译引擎。当 ASP.NET 呈现页面时,它会获取所有标记 ( <span>hello</span> )、代码 ( Control.Add(...) ) 和控件 ( <asp:button/> ) 并构建一个控件树。

这是一篇较旧的文章,但它解释了编译的工作原理:

Compilation and Deployment in ASP.NET 2.0

关于asp.net - 为什么 ASP.NET 控件树跟踪中存在大量 LiteralControl?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8328569/

相关文章:

c# - ASP.NET 如何访问 Aplication Request 模块中的 User.Identity.IsAuthenticated?

c# - 如何在 ASP.NET 中找到当前页面的(文件)名称?

c# - 如何获取属性树的踪迹?

linux - 分析一个(可能受 I/O 限制的)进程以减少延迟

asp.net - ASP.NET Azure 中的 Trace.WriteLine

c# - 由于文本框内容而导致的 PageRequestManagerServerErrorException

asp.net - 通过Asp.net背后的代码访问虚拟目录文件夹

jquery - 如何刷新标签

asp.net-mvc - 使用 MVC URL 路由覆盖目录列表

css - 使用 CSS 对齐 div 内的控件