Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Sep 09, 2008 05:55 PM by iceweasel
Member
11 Points
3 Posts
Jan 20, 2007 06:15 PM|LINK
Trying to concatenate a string literal with a eval statement for a label in my datalist itemtemplate:
<
works fine and properly shows the date posted if I remove the POSTED ON: above
If I run it as above, get ONLY the POSTED ON: displaying, with the eval seemingly not performing (but no error)
know I can manage this through rowdatabound in this datalist I'm using, but this seems simpler
(also, know I could combine the literal and the bind directly in the template with:
POSTED ON: <%# eval("TopicPosted") %> <br />
but need the label here as I turn it's visibility on/off due to other conditions)
is it the server control somehow does not allow concatenating a literal with an eval in a property?
Binding eval DataBind DataBinding
All-Star
17778 Points
3189 Posts
MVP
Jan 20, 2007 07:35 PM|LINK
Did you try: text='<%# "POSTED ON:" + eval("TopicPosted") %>'?
Hope this helps,
Vivek
2 Points
1 Post
Sep 09, 2008 05:55 PM|LINK
Try:
text='<%# "POSTED ON: " + eval("TopicPosted") %>'
Dano
Member
11 Points
3 Posts
Binding question concatenating a string literal with eval
Jan 20, 2007 06:15 PM|LINK
Trying to concatenate a string literal with a eval statement for a label in my datalist itemtemplate:
<
asp:label runat="server" id="lblPosted" text='POSTED ON: <%# eval("TopicPosted") %>' />works fine and properly shows the date posted if I remove the POSTED ON: above
If I run it as above, get ONLY the POSTED ON: displaying, with the eval seemingly not performing (but no error)
know I can manage this through rowdatabound in this datalist I'm using, but this seems simpler
(also, know I could combine the literal and the bind directly in the template with:
POSTED ON: <%# eval("TopicPosted") %> <br />
but need the label here as I turn it's visibility on/off due to other conditions)
is it the server control somehow does not allow concatenating a literal with an eval in a property?
Binding eval DataBind DataBinding
vivek_iit
All-Star
17778 Points
3189 Posts
MVP
Re: Binding question concatenating a string literal with eval
Jan 20, 2007 07:35 PM|LINK
Did you try: text='<%# "POSTED ON:" + eval("TopicPosted") %>'?
Hope this helps,
Vivek
Communifire: Social Networking and Business Collaboration Platform
iceweasel
Member
2 Points
1 Post
Re: Binding question concatenating a string literal with eval
Sep 09, 2008 05:55 PM|LINK
Try:
text='<%# "POSTED ON: " + eval("TopicPosted") %>'