如何动态地在所需位置定位UpdateProgress? [英] How to position UpdateProgress at desired location dynamically ?
问题描述
点击提交按钮后,我想通过设置关于左和顶部的样式,在页面的所需位置放置更新进度图像的显示
。 />
我尝试使用以下代码,但顶部:1360px没有被更改,因此进度图像仅显示在该位置。使用'button4'控件我也尝试使用'原因验证= false'并尝试动态更改为顶部:1650px,但进度图像的位置没有改变。可以指导吗?
After 'Submit' button clicked I want to position the display of Update Progress image
at desired location of the page by setting the styles with regard to 'left' and 'top'.
I tried with the following code but the top:1360px is not getting changed and so the progress image is displaying at that position only. With the 'button4' control I also tried with 'Causes Validation=false' and tried changing to top:1650px dynamically but the position of the progress image is not getting changed. Can any on guide?
.style56w
{
background-color:White;
padding: 1px;
width: 57px;
height: 50px;
Top:1360px;
Left:720px;
position: absolute;
}
<asp:Button ID="Button4" runat="server"
onclick="Button4_Click"
style="z-index: 1; left: 185px; top: 2840px; position: absolute; background-color:InactiveBorder; height:30px; width:80px; font-size:large " ForeColor="Green" Text="Submit" />
<asp:Button ID="Button5" runat="server"
onclick="Button5_Click" CausesValidation="false"
style="z-index: 1; left: 300px; top: 2840px; position: absolute;background-color:InactiveBorder;height:30px; width:80px;font-size:large " ForeColor="Red" Text="Cancel" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label99" runat="server" Width="145px"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button4" EventName="Click"/>
</Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" DynamicLayout=true AssociatedUpdatePanelID="UpdatePanel1" runat="server" >
<ProgressTemplate>
<table cellspacing="1" class="style56w" runat="server" id="table76" style=" position:absolute;">
<tr>
<td>
<asp:Image ID="Image21" runat="server" DescriptionUrl="~/images/updateprogress.gif"
Height="60px" ImageUrl="~/images/updateprogress.gif" Width="20px" BackColor="White"/>
</td>
</tr>
</table>
</ProgressTemplate>
</asp:UpdateProgress>
protected void Button4_Click(object sender, EventArgs e) // submit button
{
HtmlTable table = UpdateProgress1.Controls[0].FindControl("table76") as HtmlTable;
table.Style.Add(HtmlTextWriterStyle.Top, "1675px");
推荐答案
我花了很长时间才弄明白。我认为你试图制作一个模态进度指标。你必须使用%
所以你首先制作一个面具,并覆盖它上面的进度
That took me a long time to figure out. I think your trying to make a modal progress indicator. You have to use %
So you make a mask first, and overlay the progress on it
<div style="background-color: rgb(0,0,0); width: 100%; height: 100%; zindex: 10001; position: fixed; top: 0px; left: 0px; filter: alpha(opacity=60); -moz-opacity: .60; opcacity: .6;"></div>
<div style="width: 140px; height: 46px; textalign: center; margin: 0px auto; zindex: 100010; position: absolute; top: 45%; left: 45%; background-color: rgb(0,0,0); border: olid 2px rgb(255,255,255); -moz-border-radius: 10px; border-radius: 10px;">
<table>
<tr>
<td><img src="" /><span>Working ...</span></td>
</tr>
</table>
</div>
这篇关于如何动态地在所需位置定位UpdateProgress?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!