【发布时间】:2014-02-13 04:48:22
【问题描述】:
我是 rowdatabound 事件中的服务器调用。由于多次服务器调用,页面加载缓慢。如何在页面加载时调用服务器。必须在行数据绑定中访问查询的数据。任何帮助表示赞赏....
protected void Grid_course_RowDataBound(object sender, GridViewRowEventArgs e)
{
/*Tooltip.............................................*/
connect con = new connect(date);
Boolean bo = false;
IList<connect.Courses> ob = con.getCoursedetails();
Dictionary<string, string> tooltip = new Dictionary<string, string>();
for (int i = 0; i < ob.Count; i++)
{
if (!tooltip.ContainsKey(ob[i].Name.ToString()))
tooltip.Add(ob[i].Name.ToString(), ob[i].Course_Description__c.ToString());
}
------------------
--------------------
}
该类连接到 salesforce 并检索数据。对于绑定的每一行,它将从 salesforce 查询数据。
【问题讨论】:
-
向我们展示多次调用的代码
-
连接需要多长时间?您每行执行一次 - 必须有更好的连接位置。