code_junkie

asp:UpdateProgress - surpressing the line-break

Nov 10th, 2011
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. <form id="form1" runat="server">
  2. <div>
  3. <asp:ScriptManager ID="sm" runat="server"></asp:ScriptManager>
  4.  
  5.  
  6. <asp:UpdatePanel runat="server" ID="up1" UpdateMode="Always">
  7. <ContentTemplate>
  8. <asp:Label ID="lblTest" runat="server"></asp:Label>
  9. <asp:Button ID="btnTest" runat="server" Text="Test" OnClick="btnTest_OnClick" />
  10. </ContentTemplate>
  11. </asp:UpdatePanel>
  12. <img id="loadingImg" src="../../../images/loading.gif" style="display:none;"/><span>Some Inline text</span>
  13.  
  14. <script>
  15.  
  16. Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(function(sender, args) {
  17. if (args.get_postBackElement().id == "btnTest") {
  18. document.getElementById("loadingImg").style.display = "inline";
  19. }
  20. });
  21.  
  22.  
  23. Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(sender, args) {
  24. if (document.getElementById("loadingImg").style.display != "none") {
  25. document.getElementById("loadingImg").style.display = "none";
  26. }
  27. });
  28.  
  29. </script>
  30.  
  31. </div>
  32. </form>
  33.  
  34. public partial class updateProgressTest : System.Web.UI.Page
  35. {
  36. protected void btnTest_OnClick(object sender, EventArgs e)
  37. {
  38. System.Threading.Thread.Sleep(1000);
  39. this.lblTest.Text = "I was changed on the server! Yay!";
  40. }
  41. }
  42.  
  43. <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
  44. <ContentTemplate>
  45. ..........
  46. <span style="position:absolute;">
  47. <asp:UpdateProgress ID="UpdateProgress1" runat="server"
  48. AssociatedUpdatePanelID="UpdatePanel1">
  49. <ProgressTemplate>
  50. <img alt="please wait..."src="/Images/progress-dots.gif" />
  51. </ProgressTemplate>
  52. </asp:UpdateProgress>
  53. </span>
  54. </ContentTemplate>
  55. </asp:UpdatePanel>
  56.  
  57. <div class="load-inline">LOADER HERE</div>
  58.  
  59. .load-inline {display:inline-block}
  60.  
  61. <style type="text/css">
  62. .tbx
  63. {
  64. float:left;
  65. }
  66.  
  67. <asp:TextBox CssClass="tbx" .... />
  68.  
  69. <div style="display:inline">stuff</div>
Add Comment
Please, Sign In to add comment