How to use SimpleWorkerRequest?

  • Thread starter Thread starter George Ter-Saakov
  • Start date Start date
G

George Ter-Saakov

In my ASPX page i want to output the result of another ASPX page to the
file.
So i wrote following code
private void Page_Load(object sender, System.EventArgs e)

{

StreamWriter sw = new StreamWriter("c:\\TestFile.txt");

SimpleWorkerRequest wr= new SimpleWorkerRequest("General.aspx", "", sw);

HttpRuntime.ProcessRequest(wr);

}

But second line throws an exception

System.NullReferenceException: Object reference not set to an instance of an
object.


I can hit General.aspx with the browser and it works without any problem.

Thanks.
George.
 
Thit is not what i want.

I want to run ASPX page inside of my WebApplication (so session will be the
same ) and capture the HTML.


George.
 
Back
Top