Creating controls on the fly at runtime, and databinding them...?
In XML/HTML I can do:
Code:
<asp:Label id="lblDescription" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Description") %>'>
</asp:Label>
Now...I would like to do this in code behind:
Code:
Dim lblDescription As New Label
lblDescription. ???? How do I add binding here?
Me.Controls.Add lblDescription
Is this possible?
Woka
Re: Creating controls on the fly at runtime, and databinding them...?
Hahaha:
Code:
lbl.Text = CType(DataBinder.Eval(lbl.DataItem, "AssetName"), String)
Think that's it.
WOka