防止 asp:ImageButton 默认内联样式

发布于 2024-07-16 01:21:22 字数 153 浏览 4 评论 0原文

不幸的是,asp:ImageButton 控件呈现“border-width:0px;”的内联样式属性。 由于多种原因,这令人沮丧。 过去,我通过创建自己的自定义图像按钮控件来解决该问题,该控件不呈现内联样式属性。 我正在寻找一个更优雅的解决方案来解决这个问题。 任何想法将不胜感激。

Unfortunately the asp:ImageButton control renders an inline style attribute of "border-width:0px;" This is frustrating for a variety of reasons. In the past I have worked around the problem by creating my own custom image button control which doesn't render the inline style attribute. I am looking for a more elegant solution to the problem. Any thoughts would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔一刀 2024-07-23 01:21:22

此处是一个非常简单的ControlAdapter 演示了在需要时添加属性,并在不需要时完全删除它。

Here is a very simple ControlAdapter which demonstrates adding the attribute when desired, and leaving it off entirely when not.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文