绑定下拉菜单会增加页面加载时间 [英] Binding dropdown increases page load time

查看:93
本文介绍了绑定下拉菜单会增加页面加载时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用asp.net和sql server.
我将下拉列表绑定到tbl_item.
tbl_item包含15627行.

当我点击页面加载时,大约需要3到5分钟即可加载页面...

是否有其他方法可以绑定下拉菜单,以便在几秒钟内加载页面.
注意:我正在使用telerik下拉控件.

我的代码:

Hi

I am working with asp.net and sql server.
I am binding dropdown to tbl_item.
tbl_item contain 15627 rows.

when i click on page load, it take approx. 3 to 5 min to load page...

Is there any different approch to bind dropdown so that within fraction of seconds page get loaded.
To note: i am using telerik dropdown control.

My code :

Dim str As String = "SELECT [item_code], [auto_id], [description], [pk_qty] from [tbl_item]"
Dim myadp As SqlDataAdapter = New SqlDataAdapter(str, conn)
Dim myds As New DataSet
myadp.Fill(myds)
With drpitem_code
    .DataTextField = myds.Tables(0).Columns("item_code").ToString
    .DataValueField = myds.Tables(0).Columns("auto_id").ToString
    .DataSource = myds
    .DataBind()
    .Items.Insert(0, New Telerik.WebControls.RadComboBoxItem("SELECT"))
End With



非常感谢您的任何帮助



Any help is greatly appreciated

推荐答案



使用分页数据源 [按需加载 [
Hi,

Use Paged Data source[^] and you can use Load on demand[^] this will resolve your issue.


用于投标您的下拉列表,您可以使用此..

1)在您的代码隐藏页面中声明一个网络方法,该方法可用于绑定下拉菜单
2)并且在页面加载时,您可以使用jquery + ajax回调来调用该方法
3)使其安静地工作,页面加载速度更快.


您还可以使用延迟加载

懒加载的刷新记录

通过WCF REST服务加载ASP.NET惰性内容 [
For Biding Your Dropdown you can use this..

1) Declare a webmethod in your codebehind page that will work for binding your dropdown
2) and at the time of page load you can call that method using jquery + ajax call back
3) so that work silently and your page is loaded faster.


and you can also use a lazy loading

Refrance for Lazy Loading

ASP.NET Lazy Content Loading Through WCF REST Service[^]


这篇关于绑定下拉菜单会增加页面加载时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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