sgomez wrote:
Great tip, thanks...
But still not working... 
this:
<asp:Label ID="Label1" runat="server" Text='<%= "Hello " + "World!"%>'></asp:Label>
generates this:
<span id="Label1"><%= "Hello " + "World!"%></span>
Text property expects a string, and if the tag is not <%# %>, it will consider that a literal string; <%= Hello + World %> in this case. If you want evaluation on the front page, you'd need <%# %>, but that will require you to raise DataBind event.
One nice thing about <%# %> is you can put them anywhere... such as
<asp:Repeater ... DataSource="<%# SomeObject.SomeCollection %>" ...>
So you can actually assign data to controls without doing it in code behind. I prefer this method because it lets me see where I'm getting the data from.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.