Namespace Classes used by DataBinder

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
 
M

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
 
K

Karl Seguin

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!)
 
M

MattC

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
 
M

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top