M
Merkisson Jourhanssen
I will be using LoadControl to add user control to aspx page at runtime. The
user control hosts a server control (custom menu component) which requires
property setting to display menu correctly:
// In user control set property of custom menu to be value of myInt
myCustomMenuServerControl.Orientation = myInt;
Value of myInt must come from hosting aspx page.
1. In what event of hosting aspx page should I have LoadControl call? (Init?
Page_Load?). What is difference?
2. How do I pass value for myInt from aspx to user control? Do I make myInt
a property of user control and set value of it after LoadControl in aspx? Is
better way?
Thank you.
user control hosts a server control (custom menu component) which requires
property setting to display menu correctly:
// In user control set property of custom menu to be value of myInt
myCustomMenuServerControl.Orientation = myInt;
Value of myInt must come from hosting aspx page.
1. In what event of hosting aspx page should I have LoadControl call? (Init?
Page_Load?). What is difference?
2. How do I pass value for myInt from aspx to user control? Do I make myInt
a property of user control and set value of it after LoadControl in aspx? Is
better way?
Thank you.