As a regular DataBinder.Eval() user, now I feel a little bit guilty after
reading
this KB article, and I'm curious how many ASP.NET developers use explicit
casting on a regular basis. Drop me a line and let me know.
Let's say you are binding to a DataSet. This...
<%# ((System.Data.DataRowView)Container.DataItem)["au_id"]
%>
...is significantly faster than this...
<%# DataBinder.Eval(Container.DataItem,
"au_id") %>
The DataBinder.Eval method uses reflection to
evaluate the arguments that are passed in and to return the results. If you
have a table that has 100 rows and 10 columns, you call DataBinder.Eval
1,000 times if you use DataBinder.Eval on each column. Your choice to
use DataBinder.Eval is multiplied 1,000 times in this scenario.
Limiting the use of DataBinder.Eval during data binding operations
significantly improves page performance.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenetchapt05.asp