LinkButton 中的嵌套控件不可单击
我正在开发复合自定义控件。
在上述控件中,我继承自 LinkButton。在此 LinkButton 中,我嵌套了一个 Label 控件和 5 个 Image 控件。
我能够正确渲染所有内容,并且我已经让 btton 执行单击事件和所有操作,但是,有一个小问题:
渲染按钮后,嵌套控件出现在链接按钮上方,因此链接按钮是这些添加的控件所在的位置不可点击...
我想知道,有没有办法将它们放在链接按钮或其他东西后面?那么按钮仍然可以点击吗?
提前致谢!
I am working on a Composite custom control.
In said control, I am inheriting from LinkButton. In this LinkButton, I am nesting a Label Control and 5 Image controls.
I am able to render everything properly, and I´ve got the btton doing its on click events and everything, however, there´s a slight problem:
Once the button has rendered, the nested controls appear above the linkbutton, so that the linkbutton is not clickable where these added controls are...
What I want to know, is there a way to place them behind the linkbutton or something? So that the button is still clickable?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我强烈建议从 CompositeControl 继承,因为这是针对这种情况的基类。然后,您可以在所需的位置渲染出链接按钮,并将其添加到内部控件集合中。
I would highly recommend inheriting from CompositeControl, as that is the base class meant for situations like this. Then you can render out the linkbutton at the point you want, and add it to the inner control collection.