c# - How to create components (labels) on the fly? (or how to create facebook/hotmail-style to add contacts to message) -
What I want to do is make the Hotmail / Fax-style list as selected contacts. 1 small block With an "X" to remove each item and
How can I get it? NET?
I thought of making new labels "on the fly" and NET's Ajax update panel ..
But can I do this? If so, how can I make a label on the fly, and where can I just keep it?
I want the item to be created in the list (
)
Assume that you have a panel anywhere:
label myLabel = new label (); MyLabel.Text = "My name"; MyLabel.CssClass = "labelClass"; PnlItems.Controls.Add (mylabel);
ul / li item (or for fully customization):
HtmlGenericControl ulControl = new HtmlGenericControl ("ul"); PnlItems.Controls.Add (ulControl); Foreign objects (objects myThing in myItems) {HtmlGenericControl itemControl = new HtmlGenericControl ("li"); ItemControl.InnerHtml = myThing.GetMarkup (); UlControl.Controls.Add (itemControl); }
Note that this is unwanted - I'm pretty sure that you can add control to one HML generic control.
Comments
Post a Comment