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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -