S
SpaceMarine
hello,
i have an ASPX page where i bind a datasource to a Repeater. i then
render stuff in my <ItemTemplate> like so:
<td>
<%#DataBinder.Eval(Container.DataItem, "FirstName")%>,
<%#DataBinder.Eval(Container.DataItem, "LastName")%>
</td>
....thats cool, unless the above Eval()s are empty -- in which case you
end up w/ a silly-looking "," and no names.
so i want to write a function to evaluate multiple values in the
DataItem at run-time. my question is -- what can i pass into this
function in order to do this? something like this:
<td>
<%= MyFunction(Container) %>
</td>
public function MyFunction(DataItem item)
{
string returnValue = string.empty;
//do some string analysis on the passed-in item. if both names
exist, return them formatted as i like
return returnValue;
}
....the above doesnt seem quote right.
can anyone assist?
thanks!
matt
i have an ASPX page where i bind a datasource to a Repeater. i then
render stuff in my <ItemTemplate> like so:
<td>
<%#DataBinder.Eval(Container.DataItem, "FirstName")%>,
<%#DataBinder.Eval(Container.DataItem, "LastName")%>
</td>
....thats cool, unless the above Eval()s are empty -- in which case you
end up w/ a silly-looking "," and no names.
so i want to write a function to evaluate multiple values in the
DataItem at run-time. my question is -- what can i pass into this
function in order to do this? something like this:
<td>
<%= MyFunction(Container) %>
</td>
public function MyFunction(DataItem item)
{
string returnValue = string.empty;
//do some string analysis on the passed-in item. if both names
exist, return them formatted as i like
return returnValue;
}
....the above doesnt seem quote right.
can anyone assist?
thanks!
matt