Wednesday, 23 March 2011

ObjectDataSource and the greatest tip I can give about it!

Do you hate working with Eval methods when working with an object datasource...?

So do I.

Here's a tip where you can cast the source object to its original type!

<%# Container.DataItem as {insert your type to cast here} %>

The benefit of this:
  1. Its Faster!
  2. You get Intellisense on the casted obect!
  3. You can access associated functions!

No comments:

Post a Comment