在asp.net中加载页面 [英] Page loading in asp.net

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

问题描述

我有一个网站,其中包含从数据库加载的大量菜单和子菜单。

我使用Ajax加载子菜单,我注意到整页的加载时间很长。

我能做些什么来减少页面加载时间?

我使用asp.net和sql server 2005数据库。

解决方案

在您的这种情况下,您可能会发现有用的跟踪功能。它可以告诉你什么可能是错的,一旦它被启用(请按照下面的链接):

http://msdn.microsoft.com/en-us/library/0x5wc973(v = vs.100).aspx [ ^ ]



你也可以尝试以某种方式缓存查询,这样你就不必每次都检索它。



考虑优化你的sql代码,以便它在一个查询中获取所有菜单和子菜单。



我建议你在浏览应用程序之前什么也不做,直到看到问题究竟在哪里。

I have a website containing a lot of menus and submenus which are loaded from the database.
I use Ajax to load the submenus and I noticed that load time for my full page is significant.
Is there something I can do to reduce the page load time?
I use asp.net and sql server 2005 database.

解决方案

There is a trace feature you might find useful in this situation of yours. It can tell you what may be wrong, once it is enabled (follow the link below):
http://msdn.microsoft.com/en-us/library/0x5wc973(v=vs.100).aspx[^]

You can also try caching the query somehow, in which way you won’t have to retrieve it every time.

Consider optimizing your sql code, so that it fetches all menus and submenus in one query.

I suggest you do nothing until you explore the application to see where exactly is the problem.


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

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