Custom Properties in Repeaters
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Custom Properties in Repeaters

 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
Lta
Guest





Posted: Mon Nov 07, 2005 5:50 pm    Post subject: Custom Properties in Repeaters Reply with 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.
Back to top
Chester Ragel
Guest





Posted: Tue Nov 08, 2005 9:16 am    Post subject: RE: Custom Properties in Repeaters Reply with quote

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.



Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB