简体   繁体   English

如何设置控件的创建顺序?

[英]How can I set the order in which controls get created?

It seems that the order in which controls are declared in the .aspx does not guarantee the order in which they get rendered/loaded/created. 似乎在.aspx中声明控件的顺序并不能保证控件的呈现/加载/创建顺序。

Is it possible to set the order in which controls are 'rendered' ? 是否可以设置控件的“渲染”顺序? Some of my control events have side effects, that is why... (In my case I have two DetailsView controls, and I need to be sure the ItemCreated of one always gets called before the other one's). 我的某些控件事件有副作用,这就是原因...(在我的情况下,我有两个DetailsView控件,并且我需要确保始终在其中一个控件的ItemCreated调用之前)。

Maybe there is just a way to 'wait' in an event until another one is triggered ? 也许只有一种方法可以在某个事件中“等待”,直到触发另一个事件为止?

实际上,这仅是按所需顺序分别在控件上调用DataBind的问题,而不是默认使用Page.DataBind

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何处理动态创建的控件? - How can I dispose of dynamically created controls? 如何操作动态创建的控件? - How can I to manipulate dynamically created controls? 如何在其中包含许多控件的控件上绘制图形? (Z顺序最高) - How can i draw on top of an control which has many controls in it? (Z-order top) 如何以编程方式设置动态创建的控件的列和行属性以嵌入TableLayoutPanel? - How can I programmatically set the Column and Row properties of controls that are dynamically created to embed within a TableLayoutPanel? 如何从程序中创建的HiddenField中获取值? - how can I get the value from a HiddenField which created in program? 我如何获得C#asp.net在运行时中创建的所有控件的值 - how can i get value of all controls created in runtime in C# asp.net 我如何获得尊重顺序的集合的所有子集 - How can I get all subsets of a set that respect the order 如何获取命名空间中的所有控件? - How can I get all the controls in a namespace? 如何在WPF控件/控件集中获得与具有链接到其他页面内容的HTML相同的行为? - How can I get the same behavior in a WPF control/set of controls as that of HTML with links to other page content? 如何制作 function 来重新定位和调整一组控件的大小 - How can I make a function to relocate and resize a set of controls
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM