code_junkie

UpdatePanel Slowness in IE

Nov 12th, 2011
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 KB | None | 0 0
  1. function showAttendMenu(callingControl, guid) {
  2. var myPnl = $get('" + this.MyPnl.ClientID + @"')
  3. if(myPnl) {
  4. var displayIDFld = $get('" + this.AttendanceFld.ClientID + @"');
  5. var myStyle = myPnl.style;
  6. if(myStyle.display == 'block' && (guid== '' || guid == displayIDFld.value)) {
  7. myStyle.display = 'none';
  8. } else {
  9. // Get a reference to the PageRequestManager.
  10. var prm = Sys.WebForms.PageRequestManager.getInstance();
  11.  
  12. // Unblock the form when a partial postback ends.
  13. prm.add_endRequest(function() {
  14. $('#" + this.MyPnl.ClientID + @"').unblock({ fadeOut: 0});
  15. });
  16.  
  17. var domEl = Sys.UI.DomElement;
  18. //Move it into position
  19. var loc = domEl.getLocation(callingControl);
  20. var width = domEl.getBounds(callingControl).width;
  21. domEl.setLocation(myPnl, loc.x + width, loc.y - 200);
  22.  
  23. //Show it and block it until we finish loading the data
  24. myStyle.display = 'block';
  25. $('#" + this.MyPnl.ClientID + @"').block({ message: null, overlayCSS: { backgroundColor:'#fff', opacity: '0.7'} });
  26.  
  27. //Load the data
  28. if(guid != '') { displayIDFld.value = guid; }
  29. __doPostBack('" + UpdatePanel1.ClientID + @"','');
  30. }
  31. }}
  32.  
  33. // In your aspx.cs define the server-side method marked with the
  34. // WebMethod attribute and it must be public static.
  35. [WebMethod]
  36. public static string HelloWorld(string name)
  37. {
  38. return "Hello World - by " + name;
  39. }
  40.  
  41. // Call the method via javascript
  42. PageMethods.HelloWorld("Jimmy", callbackMethod, failMethod);
  43.  
  44. <script type="text/javascript" src="<%=Response.ApplyAppPathModifier("~/js/jquery-1.2.6.js") %>"></script>
  45. <script type="text/javascript" src="<%=Response.ApplyAppPathModifier("~/js/jquery.blockUI.js") %>"></script>
  46. <asp:Panel CssClass="PopOutBox noPrint" ID="MyPnl" style="display: none; z-index:1000; width:230px; position: absolute;" runat="server">
  47. <cmp:Image MyImageType="SmallCancel" CssClass="fright" runat="server" ID="CloseImg" AlternateText="Close" />
  48. <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
  49.  
  50. <ContentTemplate>
  51. <asp:HiddenField ID="AttendanceFld" runat="server" />
  52. <asp:HiddenField ID="DatePickerFld" runat="server" />
  53. <table width="100%">
  54. <tr>
  55. <td valign="top">
  56. <asp:RadioButtonList EnableViewState="false" ID="AttendRBL" runat="server" RepeatDirection="Vertical">
  57. <asp:ListItem Selected="True" Text="On Time" Value="" />
  58. <asp:ListItem Text="Late" Value="Late" />
  59. <asp:ListItem Text="Absent" Value="Absent" />
  60. <asp:ListItem Text="Cleaning Flunk" Value="Other" title="This is used for things like cubby flunks" />
  61. <asp:ListItem Text="Major Cleaning Flunk" Value="Major" title="This is used for things like White Glove flunks" />
  62. </asp:RadioButtonList>
  63. </td>
  64. <td valign="top" style="text-align: center; vertical-align: middle;">
  65. <asp:CheckBox EnableViewState="false" ID="ExcusedCB" runat="server" />
  66. <br />
  67. <asp:Label ID="Label1" EnableViewState="false" AssociatedControlID="ExcusedCB" Text="Excused"
  68. runat="server" />
  69. </td>
  70. </tr>
  71.  
  72. <tr>
  73. <td colspan="2">
  74. <asp:Label EnableViewState="false" ID="Label2" Text="Notes" runat="server" AssociatedControlID="DataTB" />
  75. <cmp:HelpPopUp EnableViewState="false" runat="server" Text='Must include "Out Sick" to be counted as ill on reports and progress reports' />
  76. <br />
  77. <asp:TextBox ID="DataTB" EnableViewState="false" runat="server" Columns="30" /><br />
  78. <div style="font-size: 10px; text-align:center;">
  79. <a href="#" onclick="setAttendVal('<%=this.DataTB.ClientID%>','Out Sick');return false;">
  80. (Ill)</a> <a href="#" onclick="setAttendVal('<%=this.DataTB.ClientID%>','In Ethics');return false;">
  81. (Ethics)</a> <a href="#" onclick="setAttendVal('<%=this.DataTB.ClientID %>','Warned');return false;">
  82. (Warned)</a>
  83. </div>
  84. </td>
  85. </tr>
  86. <tr>
  87. <td colspan="2">
  88. <cmp:ImageButton ID="DeleteBtn" OnClientClick="showAttendMenu(this,'');" OnClick="DeleteAttendance" ButtonType="SmallDelete"
  89. CssClass="fright" runat="server" />
  90. <cmp:ImageButton ID="SaveBtn" OnClientClick="showAttendMenu(this,'');" OnClick="SaveAttendance" ButtonType="SmallSave" runat="server" />
  91. </td>
  92. </tr>
  93. </table>
  94. </ContentTemplate>
  95. </asp:UpdatePanel>
  96. </asp:Panel>
Add Comment
Please, Sign In to add comment