In what event aspx to load user control so variable already has value?

  • Thread starter Merkisson Jourhanssen
  • Start date
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,585
Members
45,081
Latest member
AnyaMerry

Latest Threads

Top