我使用UpdateProgress来显示Postback期间的进度,得到"Microsoft JScript运行时错误:'this.get_element().style‘是空还是非对象“的运行时错误。
这是我的脚本:
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_beginRequest(BeginRequestHandler);
prm.add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
//Shows the modal popup - the update progress
var popup = $find('<%= mdlProgress.ClientID %>');
if (popup != null) {
popup.show();
}
}
function EndRequestHandler(sender, args) {
//Hide the modal popup - the update progress
var popup = $find('<%= mdlProgress.ClientID %>');
if (popup != null) {
popup.hide();
}
}设计代码:
<table>
<tr>
<td>
<ajaxToolkit:ModalPopupExtender ID="mdlProgress" runat="server" TargetControlID="UpdateProgress"
PopupControlID="UpdateProgress" BackgroundCssClass="modalBackground" />
<asp:UpdateProgress ID="UpdateProgress" runat="server">
<ProgressTemplate>
<asp:Image ID="Image1" ImageUrl="~/App_Themes/RIBO/Images/Processing.gif" AlternateText="Processing" runat="server" />
</ProgressTemplate>
</asp:UpdateProgress>
</td>
</tr>
</table>发布于 2011-01-25 12:57:01
this.get_element可能正在返回null。您可以通过警告()检查$find方法的结果。
你考虑过使用JQuery吗?这对这类事情来说是完美的。
https://stackoverflow.com/questions/4792826
复制相似问题