A
aualias
I am rewriting a web page that was previously done with ColdFusion. It has
a DataGrid and one column in the DataGrid is a dropdown list which is the
same for all rows. The ItemDataBound code looks like this...
// _viewDestinations is created once and stored in the ViewState
Private Sub dgWantList_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgWantList.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Then
Dim ctrl As Control = e.Item.FindControl("ddlDesignations")
If Not ctrl Is Nothing Then
Dim ddl As DropDownList = CType(ctrl, DropDownList)
ddl.DataSource = _viewDesignations
ddl.DataTextField = "the_text_field"
ddl.DataValueField = "the_value_field"
ddl.DataBind()
End If
End If
End Sub
The DataGrid loads very slowly, however the ColdFusion table loads quickly.
There may be other factors at work here - the two web pages are not on the
same server. I have no access to the ColdFusion code and do not know much
about ColdFusion.
The difference in load time is striking. However, the server that I am
developing on does not normally seem slow. There are 3 other dropdowns
(also asp:dropdownlists) in the DataGrid (in the table in the ColdFusion
page as well), but their values are hardcoded in the .aspx page.
My questions are...
1) Is there anything inherently wrong with the way I am creating the
DropDownList in the DataGrid?
2) Is it normal in this situation for an ASP.NET page to load slowly?
3) What can I do to speed up the page load?
Thanks.
David
a DataGrid and one column in the DataGrid is a dropdown list which is the
same for all rows. The ItemDataBound code looks like this...
// _viewDestinations is created once and stored in the ViewState
Private Sub dgWantList_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgWantList.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Then
Dim ctrl As Control = e.Item.FindControl("ddlDesignations")
If Not ctrl Is Nothing Then
Dim ddl As DropDownList = CType(ctrl, DropDownList)
ddl.DataSource = _viewDesignations
ddl.DataTextField = "the_text_field"
ddl.DataValueField = "the_value_field"
ddl.DataBind()
End If
End If
End Sub
The DataGrid loads very slowly, however the ColdFusion table loads quickly.
There may be other factors at work here - the two web pages are not on the
same server. I have no access to the ColdFusion code and do not know much
about ColdFusion.
The difference in load time is striking. However, the server that I am
developing on does not normally seem slow. There are 3 other dropdowns
(also asp:dropdownlists) in the DataGrid (in the table in the ColdFusion
page as well), but their values are hardcoded in the .aspx page.
My questions are...
1) Is there anything inherently wrong with the way I am creating the
DropDownList in the DataGrid?
2) Is it normal in this situation for an ASP.NET page to load slowly?
3) What can I do to speed up the page load?
Thanks.
David