运行时和设计时添加的控件
谁负责维护在设计时添加的Web 控件
(ASP:Button),以便在执行postBack
后可用?如果您不重新添加运行时添加的控件,它们将不可用?
Who is responsible to maintain the web controls
(ASP:Button) for example that added in the design time to be available after doing postBack
? while run-time-added controls wont be available if you do not add them back again?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ASP.NET 是负责人。您在设计时添加的控件(ASPX 或 ASCX 文件)将与代码隐藏类一起编译为单个对象。这是由编译器完成的。由于添加到页面运行时的控件在编译器执行时不可用,因此无法保留它们,您应该小心地自行执行此操作。
ASP.NET is the one responsible. Controls that you have added in the design time (ASPX or ASCX file) are compiled together with the code-behind class into a single object. This is done by the compiler. Since controls that you add to the page runtime are not available when the compiler executes, they cannot be preserved and you should take care to do it yourself.
ASP.NET 后端负责此工作。
请注意,没有“设计时添加”和“运行时添加”控件。只有静态、始终和动态地位于页面中的控件,由页面自己的(=您的)逻辑决定。
The ASP.NET backend is reponsible for that.
Note that there are no “design-time added” and “run-time added” controls. There are just controls that sit in the page statically, always, and dynamically, decided by the page's very own (=your) logic.