Force Page initialization
Posted
by Tony
on Stack Overflow
See other posts from Stack Overflow
or by Tony
Published on 2010-05-01T17:49:24Z
Indexed on
2010/05/01
17:57 UTC
Read the original article
Hit count: 135
ASP.NET
Hi
The following code is not causing Page_Load
of PhotoList
to be called. I want the control to be initialized as if it is in normal Page live cycle, what I should do.
Page pageHolder = new Page();
UserControl viewControl = (UserControl)pageHolder.LoadControl("Common/PhotoList.ascx");
pageHolder.Controls.Add(viewControl);
© Stack Overflow or respective owner