Asp.net - 编译器会更改函数名称吗?
asp.net 编译器是否会更改“Web 控件”中声明的公共方法的名称???
Does asp.net compiler change the name of public methods that are declared in a "web control" ???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个有点复杂的问题!
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.