D
darrel
*sigh*...I've asked this before, but have long forgotten the answer.
In the past, I'd often use repeater controls, bind data to it, and then
reference the data fields from within the repeater:
<%# DataBinder.Eval(Container.DataItem, "agentMobilePhone") %>
More recently, I've been doing more of the building on the codebehind side,
creating a string builder and building the table from there. When doing
that, I access the data like this:
ds.Tables(0).rows(0)("agentMobilePhone")
Both methods work fine and I see advantages and disadvantages to each.
At the moment, I'm building a table via the former...using a repeater
control. I get frustrated when I want to perform some logic on the data on
the the front-end, though.
I can't simply do this:
if DataBinder.Eval(Container.DataItem, "agentMobilePhone") = something then
as that returns a 'container' not declared error.
I can't access the DS from the front end, either:
if ds.Tables(0).rows(0)("agentMobilePhone")
as ds isn't declared.
So, when I want to do some comparison logic on data via a repeater control,
I need to make a new function on the codebehind page just for this, then
pass the data to the function.
My question is: Is there anyway to access one of the items of data in the
bound repeater from the repeater itself...without having to go back into the
codebehind?
(I know there is a way, I've just forgotten how.)
-Darrel
In the past, I'd often use repeater controls, bind data to it, and then
reference the data fields from within the repeater:
<%# DataBinder.Eval(Container.DataItem, "agentMobilePhone") %>
More recently, I've been doing more of the building on the codebehind side,
creating a string builder and building the table from there. When doing
that, I access the data like this:
ds.Tables(0).rows(0)("agentMobilePhone")
Both methods work fine and I see advantages and disadvantages to each.
At the moment, I'm building a table via the former...using a repeater
control. I get frustrated when I want to perform some logic on the data on
the the front-end, though.
I can't simply do this:
if DataBinder.Eval(Container.DataItem, "agentMobilePhone") = something then
as that returns a 'container' not declared error.
I can't access the DS from the front end, either:
if ds.Tables(0).rows(0)("agentMobilePhone")
as ds isn't declared.
So, when I want to do some comparison logic on data via a repeater control,
I need to make a new function on the codebehind page just for this, then
pass the data to the function.
My question is: Is there anyway to access one of the items of data in the
bound repeater from the repeater itself...without having to go back into the
codebehind?
(I know there is a way, I've just forgotten how.)
-Darrel