From the code on one page I want to be able to generate an instance of another page and parse the html from certain controls on that page.
this is what i have tried so far
var APIListPage = (APIList)BuildManager.CreateInstanceFromVirtualPath("~/APIHelp/APIList.aspx", typeof(APIList));
ParseHtml(APIListPage.pdfPage);
The problem is APIListPage.pdfPage
is always null
.
You must call the page instance's "ProcessRequest" procedure, to let it experience a full Page LifeCycle. It won't load just by creating the instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With