Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?


CSS
.style56w
        {
            background-color:White;
            padding: 1px;
            width: 57px;
            height: 50px;
            Top:1360px;
            Left:720px;
            position: absolute;
        }


XML
<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>


C#
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");
Posted

1 solution

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>
 
Share this answer
 
Comments
S.Rajendran from Coimbatore 25-Oct-14 6:49am    
How to position the img at required location in the page dynamically in C#?
jkirkerx 25-Oct-14 13:37pm    
That's what Javascript is for. To manipulate the DOm o rpage HTML in the browser on the client side, not on the server side. So you write javascript to alter CSS style in HTML elements to change colors, sixe, whatever you like.

I think you phrased your question wrong.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900