部分页面加载asp.net [英] partial page loading asp.net

查看:112
本文介绍了部分页面加载asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个仪表板,其中多个控件可以访问具有大量数据的不同视图.
控件是简单的控件,没有太多的复杂性.这些控件调用单独的存储过程,并在页面加载时同步绑定.

我希望这些控件异步加载.因此,页面加载不会等待所有控件绑定发生.

每个服务器都应能够分别加载并带有进行中"的图像.

什么是最好的方法?以下是我想到的几件事

1.我想到将其放在更新面板中,然后在页面加载后通过javascript更新它.
2.使用jquery.load方法

请提出建议.

Hi,

I have a dashboard where multiple controls access different views which has huge data.
Controls are simple controls and does not have much complexity.These controls calls separate stored procedures and are binded on page load synchronously.

I want these controls to load asynchronously.So that page load does not wait for all controls binding to happen.

Each should be able to load separatly and with a "in progress" image.

What is the best way? Following are few things i thought of

1. I thought of putting it in an update panel and then updating it through javascript after page load.
2. Using jquery.load method

Please suggest.

推荐答案

您可以进行JQuery延迟加载
You can go for JQuery Lazy Loading


要异步加载,您需要使用ajax来加载页.如果您不了解Ajax,请在Google Ajax中找到许多代码示例.即使在codeproject中,也有一些关于ajax的好文章.

该概念在页面末尾正好位于结束表单标记之前被称为客户端方法.

该方法将调用ajax从数据库获取数据并使用该数据-生成html.生成html后,将其放在div innerHTML中.

在方法开始时,显示进度格.
在方法末尾,隐藏div.

希望这会有所帮助
欢呼声
To load asynchronously, you need to use ajax to load the page. If you are not aware of ajax, google Ajax to find many code samples. Even in codeproject there are some good articles on ajax.

The concept is call a client method at the end of the page just before end form tag.

The method will call ajax to get the data from database and using the data - generate the html. Once the html is generated, place it in a div innerHTML.

At the start of the method, show a progress div.
At the end of the method, hide the div.

Hope this helps
cheers


如果您使用的是Web服务,那么我的建议是,在页面加载完成后,您将调用WebService的WebMethod来获取新文章,当您获得该文章时,您可以使用JavaScript和要在页面中显示的DOM.

看看下面的链接,

If you are using the web services means my suggestion is, after the page has finished loading you would call the WebService’s WebMethod to get a new article, when you get the article you could use JavaScript and the DOM to show it in the page.

Have a look on the below links,

http://www.asp.net/ajax/documentation/live/tutorials/ExposingWebServicesToAJAXTutorial.aspx

http://www.asp.net/ajax/documentation/live/tutorials/ConsumingWebServicesWithAJAXTutorial.aspx


这篇关于部分页面加载asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆