davidseye
03-13-2003, 06:14 AM
I have populated a datalist from a database table and applied the results in the page with an item template. This is the code:
<ASP:DataList id="NavLinkList" runat="server">
<ItemTemplate>
<table>
<tr>
<td valign="top">
<a href="../<%# DataBinder.Eval(Container.DataItem, "navLink") %>" target="<%# DataBinder.Eval(Container.DataItem, "target") %>"><span style="font-size:8pt;color:white;text-decoration:none;"><%# DataBinder.Eval(Container.DataItem, "navText") %></span></a>
</td>
</tr>
</table>
</ItemTemplate>
</ASP:DataList>
What I need help with is this. The target value has extra white space which I would like to apply the trim function to remove, but all my attempts to now have proven futile. Can anyone suggest how I can trim this: <%# DataBinder.Eval(Container.DataItem, "target") %> ?
Or perhaps I should bind the data to a different control: a hyperlink or a repeater. What do you think?
Thanks
<ASP:DataList id="NavLinkList" runat="server">
<ItemTemplate>
<table>
<tr>
<td valign="top">
<a href="../<%# DataBinder.Eval(Container.DataItem, "navLink") %>" target="<%# DataBinder.Eval(Container.DataItem, "target") %>"><span style="font-size:8pt;color:white;text-decoration:none;"><%# DataBinder.Eval(Container.DataItem, "navText") %></span></a>
</td>
</tr>
</table>
</ItemTemplate>
</ASP:DataList>
What I need help with is this. The target value has extra white space which I would like to apply the trim function to remove, but all my attempts to now have proven futile. Can anyone suggest how I can trim this: <%# DataBinder.Eval(Container.DataItem, "target") %> ?
Or perhaps I should bind the data to a different control: a hyperlink or a repeater. What do you think?
Thanks