问题
I got the trick from stackoverflow to hide the loading message by manipulating the DOM with jQuery. Adding the following script to the page with the reportviewer did the trick:
<script type="text/javascript">
$(function () {
var waitMsg = $("div[id$='AsyncWait_Wait']");
waitMsg.wrap("<div style='display:none; visibility: hidden'></div>");
});
rather i want to show my own message and image at center of page. just guide me how to show my message before rendering report in my page. which method i need to hook. onwindowload something like.
回答1:
You can do that by using css
<style type="text/css" media="screen">
/* commented backslash hack for ie5mac \*/
html, body{height:100%;}
/* end hack */
.CenterPB{
position: absolute;
left: 50%;
top: 50%;
margin-top: -30px; /* make this half your image/element height */
margin-left: -30px; /* make this half your image/element width */
}
</style>
and you have the progress bar in the div
$(function () {
var waitMsg = $("div[id$='AsyncWait_Wait']");
waitMsg.wrap("<div class='CenterPB'
style='display:none;height:60px;width:60px;'>Message here</div>");
});
reference:
http://www.sitepoint.com/forums/1243542-post9.html
http://www.search-this.com/2008/05/15/easy-vertical-centering-with-css/
Making Update Progress Panel in the center
回答2:
You could just add it to the same exact function. Something like
$(function() {
//Get message ref
var waitMsg = $("div[id$='AsyncWait_Wait']");
//Add custom message
var customMessage = $(document.createElement("div"));
customMessage.text("My message...");
waitMsg.before(customMessage);
//Hide message
waitMsg.wrap("<div style='display:none; visibility: hidden'></div>");
});
来源:https://stackoverflow.com/questions/9377305/want-to-show-custom-wait-control-at-center-of-page