Asp.net - 编译器会更改函数名称吗?

发布于 2024-09-18 12:38:34 字数 45 浏览 2 评论 0原文

asp.net 编译器是否会更改“Web 控件”中声明的公共方法的名称???

Does asp.net compiler change the name of public methods that are declared in a "web control" ???

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ヤ经典坏疍 2024-09-25 12:38:34

这是一个有点复杂的问题!

Asp.Net 网站可以是“Web 应用程序”,通常完全编译为 .dll,在这种情况下,命名在编译时固定。 C# 和 VB.Net 非常擅长保持声明的名称。

如果您正在运行“网站”,则名称空间存在不同的限制,这意味着编译器必须“猜测”定义良好的名称(这通常会导致“ASP_.mytype”或类似的结果。

当涉及到在网站的客户端命名,您的方法实际上不再存在了,任何用户控件都会“呈现”为 HTML,通常会更改 ID 以保持客户端回发返回的结果是唯一的。 哪里

通常,asp.net 系统会使用很多技巧来使您看起来与客户端有长期连接;需要一些经验才能知道它们在

。这有助于您提出问题。

It's a bit of a complex question!

Asp.Net web sites can either be "Web Applications", normally fully compiled into .dlls, in which case the naming is fixed at compile time. C# and VB.Net are pretty good at keeping your names as declared.

If you are running a "Web Site", there are different constraints around name-spacing which means that the compiler will have to 'guess' well-defined names (this often results in "ASP_.mytype" or similar.

When it comes to naming on the client-side of a web site, your methods don't really exist anymore. Any user controls are 'rendered' into HTML, very often changing IDs to keep each unique. Returned results from a client-side post-back are mapped into a new instance of the page.

Generally, the asp.net system plays a lot of tricks to make it seem like you have a long-term connection to the client-side; it takes some experience to know where they are.

Hope that helps your frame your question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文