asp.net - Adding User controls on runtime - accessing the controls -
i'm trying add user controls on page. thats easy, this.
usercontrol block = (categoryblock) loadcontrol("categoryblock.ascx"); panel1.controls.add(block);
but want access label controls , more inside categoryblock.ascx. how ?
i cant this,
block.l_itemname.text = "blabla";
i managed user findcontrol("l_itemname") rather have intellisense.
create following property in user control:
public string itemname() { get() { return l_itemname.text; } set(string value) { l_itemname.text = value; } }
this make able block.itemname = ""
or string temp = block.itemname
i hope help
Comments
Post a Comment