ReportViewer JavaScript API
JavaScript API
One of the new features we added to the ASP.Net Report Viewer in Visual Studio 2010 is a JavaScript API to allow you to interact with the viewer on client. In reading many of the posts on the report controls forum, we found that many people struggle when implementing a custom toolbar or replacing portions of the toolbar functionality. The new JavaScript API is intended to make it easier for you to provide the same functionality available through the built-in toolbar with a minimum amount of effort.
The JavaScript API is exposed through the client side ReportViewer object. Specifically, it’s the Microsoft.Reporting.WebFormsClient.ReportViewer class. An instance of this class is created on the client for each instance of the ReportViewer control on the page.
Referencing the client side viewer
The ReportViewer client side object inherits from Sys.UI.Control. To obtain a reference to the client side viewer, use the $find method as follows:
var clientViewer = $find("ReportViewer1");
The identifier you pass to $find corresponds to the ClientID of the ReportViewer server control.
Checking the state of the viewer
Once you have a reference to the client side viewer, you will want to check the state of the viewer before invoking most of the various methods and properties it exposes. When the viewer is in a loading state, most of the functionality of the client viewer is unavailable and will throw an exception if called. The viewer is loading whenever an asynchronous postback is in progress. It is also in the loading state while retrieving a report page. This usually happens during an asynchronous postback, but can also extend beyond the lifetime of the postback, such as while retrieving images displayed on the report page. To check the state of the viewer, use the isLoading property:
var isLoading = clientViewer.get_isLoading();
Once you have dete
相关文档:
在 document 对象中有一个 cookie 属性。但是 Cookie 又是什么?“某些 Web 站点在您的硬盘上用很小的文本文件存储了一些信息,这些文件就称为 Cookie。”—— MSIE 帮助。一般来说,Cookies 是 CGI 或类似,比 HTML 高级的文件、程序等创建的,但是 JavaScript 也提供了对 Cookies 的很全面的访问权利 ......
在线编辑内容的时候,那些基于 JavaScript 的编辑器帮了我们大忙,这些所见即所得(WYSIWYG)编辑器,给我们提供了类似
Office 的操作体验。如今,任何网站内容管理系统(CMS)和博客系统都需要一个这样的编辑器。本文精选了10个基于 JavaScript
的编辑器,它们有的是基于 jQuery 框架,有点则不是。
Mar ......
1) 为什么加载javascript文件很重要?
javascript文件是比较特殊的,因为浏览器加载javascript是串行的。以为着在加载Javascript文件的时候,其他一切资源的下载包括页面的显示都会被阻塞。
2) 如何正确的加载JavaScript?
a. 将JavaScript文件放在页面的最后
因为JavaScript的加载会阻塞页面的显示,所以将JavaScrip ......
function checkImgAddr(url){
var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("post",url,false);
xmlhttp.send();
if(xmlhttp.readyState==4){
if(xmlhttp.status==404){
return "File Not Exist.";
}else if(xmlhttp.status == 200){
re ......
//获取页面数据
function getPageSize(){
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = document.body.scrollWidth;
yScroll = window.inn ......