gpt4 book ai didi

css - 在 asp :UpdateProgress 中调暗整个屏幕

转载 作者:行者123 更新时间:2023-11-28 12:47:15 25 4
gpt4 key购买 nike

我正在创建一个 ASPP.Net 网页。因为它必须加载大量的日期,最多可能需要 60 秒,所以我想通知用户这可能需要一段时间。我想将整个屏幕调暗一点并写上“正在加载,请稍等”。为此,我在 <UpdateProgress> 中创建了一个 div。 , 将其设为黑色和半透明并添加 css 属性 position: fixed; width:100%; height: 100%; .

问题是 ASP.net 转换整个 <UpdateProgress>到一个包装我定制的 div 的 div 中。这导致我的 div 只填充父 div。

所以我的问题是:如何修改<UpdateProgress>的css样式? (与其他 ASP.net 元素不同,if 似乎没有 CssClass 属性)

最佳答案

您可以将 ClientIDMode="Static" 添加到您的 UpdateProgress,这将允许您为其分配一个静态 ID,这样 .NET 就不会自动生成它,就像这样:

<asp:UpdateProgress ID="UpdateProgress" ClientIDMode="Static" runat="server" />

现在您有了一个静态 ID,您可以使用它直接将您的 CSS 样式应用到由 UpdateProgress 生成的 div

#UpdateProgress {
position: fixed;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}

关于css - 在 asp :UpdateProgress 中调暗整个屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24800057/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com