updatepanel高度更新后剩余最大尺寸

发布于 2024-08-08 03:17:10 字数 288 浏览 0 评论 0原文

使用近 4 年之后,我的一位测试人员注意到我的更新面板出现了一些奇怪的情况。

假设我有一个显示模式,它的高度为 100 像素。然后用户切换到编辑模式并且更新面板更新。窗口现在的高度为 500 像素。用户单击“保存”,它会返回到显示模式,只有 100 像素。

现在dom只需要100像素,但仍然有一个滚动条一直到500像素。如果用户将屏幕缩小到 100 像素,他/她仍然会看到一个滚动条,尽管事实上那里已经没有任何内容了。

到底是什么导致了这个问题,我该如何解决它?就像更新面板不会告诉窗口它不再需要所有的高度一样。

After almost 4 years of use, one of my testers noticed something strange with my update panels.

Let's say I have a display mode and it takes 100 pixels in height. The user then switches to edit mode and the updatepanel updates. The window is now 500 pixels in height. The user clicks save and it turns back to display mode, which is only 100 pixels.

Now the dom only takes 100 pixels, but there still is a scrollbar all the way to 500 pixels. If the user shrinks the screen down to 100 pixels, he/she will still see a scrollbar, despite the fact that there's nothing down there anymore.

What the hell is causing this and how do I fix it? It's like the updatepanel doesn't tell the window it doesn't need all that height anymore.

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

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

发布评论

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

评论(1

想你的星星会说话 2024-08-15 03:17:10

在我看来,您的控件可能使用visibility =“visible | hide”而不是display:“none | block”。

使用 IE 开发工具栏Firebug 查看页面状态期间的 DOM 结构。

也可能是您的编辑模式对于其固定高度容器来说太大。尽量不要限制最外层的容器,以便它可以随着内部内容的动态变化而增长。

可见性属性决定
给定元素是否可见或
不是(可见性=“可见|隐藏”)。
但是,当可见性设置为
隐藏,元素仍然隐藏
在布局中占据相同的位置
页面的。

CSS 属性:显示与可见性

Sounds to me like your control maybe using visibility="visible|hidden" instead of display:"none|block".

Use IE Dev Toolbar or Firebug to see what the DOM structure is during your page state.

It also may just be that your edit mode is too big for its fixed height container. Try not constrain the outermost container so it can grow with the dynamically changing internal content.

The visibility property determines
whether a given element is visible or
not (visibility="visible|hidden").
However, when visibility is set to
hidden, the element being hidden still
occupies its same place in the layout
of the page.

CSS Properties: Display vs. Visibility

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