简体   繁体   English

在中心制作更新进度面板

[英]Making Update Progress Panel in the center

I have a query regarding update progress panel.我对更新进度面板有疑问。 I want to fit update progress panel in the middle of my screen, Can anyone suggest me?我想在屏幕中间安装更新进度面板,有人可以建议我吗? what is the idea of making it so??这样做的想法是什么?

You can do that by using css您可以使用 css 来做到这一点

<style type="text/css" media="screen">
/* commented backslash hack for ie5mac \*/ 
html, body{height:100%;} 
/* end hack */
.CenterPB{
position: absolute;
left: 50%;
top: 50%;
margin-top: -30px; /* make this half your image/element height */
margin-left: -30px; /* make this half your image/element width */
}
</style>

and you have the progress bar in the div并且您在 div 中有进度条

<div class="CenterPB" style="height:60px;width:60px;" >Progress bar here</div>

reference:参考:
http://www.sitepoint.com/forums/1243542-post9.html http://www.sitepoint.com/forums/1243542-post9.html
http://www.search-this.com/2008/05/15/easy-vertical-centering-with-css/ http://www.search-this.com/2008/05/15/easy-vertical-centering-with-css/

The update progress panel displays something (some text an image some markup) while the system is processing..系统正在处理时,更新进度面板会显示一些内容(一些文本、图像、一些标记)。

So you need to work with the markup you add..所以你需要使用你添加的标记..

For example if you have a div that displays you could get it to be in the centre like this..例如,如果你有一个显示的 div,你可以让它像这样在中心。

<div style="width:200px;margin:0 auto;">Processing...</div>

That will display the div in the centre of its container.这将在其容器的中心显示 div。

Full example:完整示例:

<asp:UpdatePanel ID="updatepnl1" runat="server">
    <ContentTemplate>
        <asp:GridView id="gv1" runat="server">
        </asp:GridView>
        <asp:UpdateProgress id="UpdateProg" runat="server">
            <ProgressTemplate>
                <div style="width:200px;margin:0 auto;">Processing...</div>
            </ProgressTemplate>
        </asp:UpdateTemplate>
    </asp:ContentTemplate>
</asp:UpdatePanel>

Of course you should put the css into a css file and apply it to a class.当然,您应该将 css 放入 css 文件并将其应用于 class。

Like:喜欢:

///Start css

.posCentre{width:200px;margin:0 auto;}

///End css

and change your div to:并将您的 div 更改为:

<div class="posCentre">Processing...</div>

If you use jQuery, you may also try (very lightweight) fixedcenter plugin .如果您使用 jQuery,您也可以尝试(非常轻量级的)固定中心插件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM