Just helped out a guy that had ran into some problems with returning the value of the Text property of a label that was nested inside a DataList control.
He tried binding the value of it like this:
<asp:label id="myLabel" runat="server">Value: <%# DataBinder.Eval(Container.DataItem, "Value") %></asp:label>
This caused the Text property to return an empty string. Also when he removed <%# DataBinder.Eval(Container.DataItem, "Value") %> the property returned Value:
I suggested to him that he could place the entire inline contents of the Label control inside a text attribute in the label control, ending up with something like this:
<asp:label id="myLabel" runat="server" text='Value: <%# DataBinder.Eval(Container.DataItem, "Value") %' />
This solved his problem! I cannot truthfully say I understand why this solved his issue - perhaps it's a problem with event bubbling? Does any feel like commenting on this?