根据复选框列表调整 asp.net 面板宽度?
我有一个包含复选框列表的 asp.net 面板。我想调整它的大小,使其宽度恰好适合列表的内容。
现在我正在处理面板的预渲染事件,将其宽度设置为与复选框列表的宽度相匹配。然而,复选框列表的宽度属性似乎读取为零(至少在此预渲染方法中),因此面板的宽度设置相同,这导致 Firefox 与 IE 中的渲染不一致。有没有人有更好的方法来完成我在这里尝试的事情?非常感谢。
I have an asp.net panel that contains a checkboxlist. I'd like to resize it so that its width fits the list's contents snugly.
Right now I'm handling the panel's pre rendering event, setting its width to match that of the checkboxlist. However it appears the checkboxlist's width property reads zero (at least in this pre render method) so the panel's width is set identically, which leads to inconsistent renderings in Firefox vs IE. Does anyone have a better approach to doing what I'm attempting here? Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以设置每个 JavaScript 的面板宽度 onload:
You could set the panel width onload per javascript: