In the Code-Behind file for a Specific page I'm doing, I am using Server.Execute("anotherpage.aspx", writer) to retrieve the resulting output of a different aspx page, which I am maniuplating etc. A page within a page concept.
My problem, is that no matter what I seem to do, the Session scope does not appear to be available within the Code-behind for the "anotherpage.aspx" if I execute it with the Server.Execute() method. If I execute "anotherpage.aspx" directly in my application, the session scope object appears valid. I have ensured that the @Page directive shows EnableSessionState="True" and yet I get an error upon executing anotherpage.aspx (using Server.Execute()) that indicates "Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive ". Note, I don't get this error if executing the page directly
Any help at all is highly appreciated. Thanks.