How to: Get data from a repeater control w/out DataBinder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any other way to read data that's binded to a repeater control in a
asp.bet webform?

Currently...

<%# DataBinder.Eval(Container.DataItem, "Column1") %>

.... works fine. However, i need to manipulate the value stored in "Column1",
not just write it out in HTML. Is there any way to read this value, do
"somthing" w/ this value, and then use Response.Write() to print out the
resulting value?

Thanks,
 
Hi,

I dont quite understand what you want to do so let me know if you need
somethig else

You can intercept the value being binded and call a method, like this

<%# ProcessValue( DataBinder.Eval(Container.DataItem, "Column1") ) %>

and in the code behind you do:

protected string ProcessValue( string origValue) {}


Cheers,
 
Hello,

Check out the ItemDataBound event, which allows you to transform data
prior to rendering.

- Mike
 
Back
Top