Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form id="form1" runat="server">
- <div>
- <asp:ScriptManager ID="sm" runat="server"></asp:ScriptManager>
- <asp:UpdatePanel runat="server" ID="up1" UpdateMode="Always">
- <ContentTemplate>
- <asp:Label ID="lblTest" runat="server"></asp:Label>
- <asp:Button ID="btnTest" runat="server" Text="Test" OnClick="btnTest_OnClick" />
- </ContentTemplate>
- </asp:UpdatePanel>
- <img id="loadingImg" src="../../../images/loading.gif" style="display:none;"/><span>Some Inline text</span>
- <script>
- Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(function(sender, args) {
- if (args.get_postBackElement().id == "btnTest") {
- document.getElementById("loadingImg").style.display = "inline";
- }
- });
- Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(sender, args) {
- if (document.getElementById("loadingImg").style.display != "none") {
- document.getElementById("loadingImg").style.display = "none";
- }
- });
- </script>
- </div>
- </form>
- public partial class updateProgressTest : System.Web.UI.Page
- {
- protected void btnTest_OnClick(object sender, EventArgs e)
- {
- System.Threading.Thread.Sleep(1000);
- this.lblTest.Text = "I was changed on the server! Yay!";
- }
- }
- <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
- <ContentTemplate>
- ..........
- <span style="position:absolute;">
- <asp:UpdateProgress ID="UpdateProgress1" runat="server"
- AssociatedUpdatePanelID="UpdatePanel1">
- <ProgressTemplate>
- <img alt="please wait..."src="/Images/progress-dots.gif" />
- </ProgressTemplate>
- </asp:UpdateProgress>
- </span>
- </ContentTemplate>
- </asp:UpdatePanel>
- <div class="load-inline">LOADER HERE</div>
- .load-inline {display:inline-block}
- <style type="text/css">
- .tbx
- {
- float:left;
- }
- <asp:TextBox CssClass="tbx" .... />
- <div style="display:inline">stuff</div>
Add Comment
Please, Sign In to add comment