Namespace Classes used by DataBinder

  • Thread starter Thread starter MattC
  • Start date Start date
M

MattC

When I add a template column to a DataGrid and bind some data from an object
in a collection using the following:

<% DataBinder.Eval(Container, "DataItem.Department.DepartmentName") %>

What Namespace/Class is Eval located in and can I call if from code behind.
I have implemented my own version of reflection nased property navigation
but I'd really rather use the original wheel than reinvent it.

TIA

MattC
 
I'm just thinking, it's a really usefull little method, expecially to use in
BLL, but I dont realyl want to have to add the System.Web.UI to my BLL. I
would like if the code that parses the property to get its value (from
Something.SomethingElse) is accessible from a Reflection assembly class??

TIA

MattC
 
i believe you can via the PropertyInfo member and GetValue you can do a
google search for those and come up with some hits. Reflection might be a
powerful tool, but I'd take a long hard look to make sure it was really
necessary...I find it tends to make code less than readable.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 
True, but when was the last time Application Infrastructure codewas
generally readable LOL :p

Like I said, I do have some code that will parse a property and get its
value (or null) but figured that DataBinder.Eval (which does exacly the same
thing) must but making a call internally to a method that already does this.

MattC
 
Thanks, I'll have aread now. Agreed, its often a case of 'suck it and see'.

MattC

Scott Allen said:
I have an article "Metadata and Reflection in .NET" [1] explaining
some basics. Reflection is powerful but can hurt performance if it's
used in the wrong places.

[1] http://odetocode.com/Articles/288.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/


True, but when was the last time Application Infrastructure codewas
generally readable LOL :p

Like I said, I do have some code that will parse a property and get its
value (or null) but figured that DataBinder.Eval (which does exacly the
same
thing) must but making a call internally to a method that already does
this.

MattC
 
Back
Top