Lta
Guest
|
Posted:
Mon Nov 07, 2005 5:50 pm Post subject:
Custom Properties in Repeaters |
|
|
Hi,
i am trying to access a custom property value in a repeater control.
I can access the DisplayName and URl but not the Custom Property.
The error is "DataBinder.Eval: 'ToString()' is not a valid indexed
expression."
Code:
<ItemTemplate>
<li class="<%# DataBinder.Eval(Container.DataItem,
"CustomProperties['cssClass'].Value.ToString()") %>">
<a href="<%# DataBinder.Eval(Container.DataItem, "URL") %>"><%#
DataBinder.Eval(Container.DataItem, "DisplayName") %></a>
</li>
</ItemTemplate>
The repeater is bound to an array of channels Channels[].
Note: not all channels have this custome property.
Many thanks in advance. |
|
Chester Ragel
Guest
|
Posted:
Tue Nov 08, 2005 9:16 am Post subject:
RE: Custom Properties in Repeaters |
|
|
Hi,
Did you try with index than the property name 'cssClass'? Also why you are
having ToString()?
Cheers,
Chester.
"Lta" wrote:
| Quote: | Hi,
i am trying to access a custom property value in a repeater control.
I can access the DisplayName and URl but not the Custom Property.
The error is "DataBinder.Eval: 'ToString()' is not a valid indexed
expression."
Code:
ItemTemplate
<li class="<%# DataBinder.Eval(Container.DataItem,
"CustomProperties['cssClass'].Value.ToString()") %>"
<a href="<%# DataBinder.Eval(Container.DataItem, "URL") %>"><%#
DataBinder.Eval(Container.DataItem, "DisplayName") %></a
</li
/ItemTemplate
The repeater is bound to an array of channels Channels[].
Note: not all channels have this custome property.
Many thanks in advance.
|
|
|