Y
Yan Wang
Hi!:
I encounter this problem when I do some tests:
I have one user control with datalist in it. The ID for
datalist is "dlTest". Then in this control code behind class, I
declare a protected attribute like "DataList dlTest"
Then I create a test asp page to load my control dynamically.
by using "LoadControl("controls\MyTest.ascx")"
The load is fine and work perfectly. But dlTest
in the Page_Load method of my control class is always null.
If I do not use dynamic loading, it works fine. Does anyone
know the reason?
Thanks for any help!
Yan
I encounter this problem when I do some tests:
I have one user control with datalist in it. The ID for
datalist is "dlTest". Then in this control code behind class, I
declare a protected attribute like "DataList dlTest"
Then I create a test asp page to load my control dynamically.
by using "LoadControl("controls\MyTest.ascx")"
The load is fine and work perfectly. But dlTest
in the Page_Load method of my control class is always null.
If I do not use dynamic loading, it works fine. Does anyone
know the reason?
Thanks for any help!
Yan