Hello,
In ASP.Net 3.5 unleashed, it states that EVAL is inefficient in template columns as it uses reflection (30% less efficient I read on one blog).
Their suggested alternative is the following syntax:
replace: Eval("Title")
with: ((System.Data.D ataRowView)Cont ainer.DataItem)["Title"]
Looks simple enough, but it barfs with:
"Unable to cast object of type System.Data.Com mon.DataRecordI nternal to type System.Data.Dat aRowView"
(I tried to cast it to DataRecordInter nal but it is a protected class).
I've hunted high and low via Google, but to no avail.
Anyone know where it's going wrong?
(btw I'm using c#)
In ASP.Net 3.5 unleashed, it states that EVAL is inefficient in template columns as it uses reflection (30% less efficient I read on one blog).
Their suggested alternative is the following syntax:
replace: Eval("Title")
with: ((System.Data.D ataRowView)Cont ainer.DataItem)["Title"]
Looks simple enough, but it barfs with:
"Unable to cast object of type System.Data.Com mon.DataRecordI nternal to type System.Data.Dat aRowView"
(I tried to cast it to DataRecordInter nal but it is a protected class).
I've hunted high and low via Google, but to no avail.
Anyone know where it's going wrong?
(btw I'm using c#)
Comment