Unable to create a composite control that includes the toolbar control.
上次发布: August 25, 2014No Product Found
漏洞 ID 编号
NIM000578
已提交
December 13, 2005
上次修改时间
June 5, 2024
适用范围
No Product Found
找到的版本
9.1
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
No Public Explanation
解决办法
The user is using the following workaround:The workaround is to not use INamingContainer. To work around the problem of events getting lost by not using INamingContainer, you must override the FindControl() method of every container in the control container chain. The overridden FindControl() must search it's controls as well as ask each of it's controls to subsequently search their controls. Thus, FindControl() will end up searching down the whole chain of contained controls in order to find the control that was asked for. You must also ensure that each control is manually given a unique ID. Here is an example of my overridden FindControl(): public override Control FindControl(string id) { EnsureChildControls(); foreach (Control control in this.Controls) { if ( <a href="http://control.ID" target="_blank">control.ID</a> == id ) return control; Control found = control.FindControl(id); if ( found != null ) return found; } return base.FindControl (id); }I'd obviously still rather use INamingContainer, but this seems to be working for now.