如何创建ASPX页面的实例?

时间:2022-10-16 18:09:54

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.

从一个页面上的代码中,我希望能够生成另一个页面的实例,并从该页面上的某些控件解析html。

code which I used is:

我使用的代码是:

var APIListPage = (APIList)BuildManager.CreateInstanceFromVirtualPath
    ("~/APIHelp/APIList.aspx", typeof(APIList));

ParseHtml(APIListPage.pdfPage);

1 个解决方案

#1


3  

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

您必须调用页面实例的“ProcessRequest”过程,让它体验完整的页面生命周期。它不会仅仅通过创建实例来加载

#1


3  

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

您必须调用页面实例的“ProcessRequest”过程,让它体验完整的页面生命周期。它不会仅仅通过创建实例来加载