Hi,
>>Where is the native reference not available ?
>
>The framework is Framework.dll. The DLL doesn't have any knowledge of the ASP.NET objects nor does any code behind but to the ASPX itself which I don't have any code in there except for object instantiations. Those need to be hooked up as properties at the higher level. So, any call made to the framework or to a code behind can then have a reference to the ASP.NET objects such as oApp.oResponse or oApp.oRequest.
>
>Each ASPX have a Page_Load() as simple as this:
>
>
><script runat="server">
> Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
> Dim loDataEntry As DataEntryPurchase = New DataEntryPurchase(LXFramework)
> loDataEntry.GenerateForm()
> End Sub
></script>
>
>
>where the object instantation is the one I wish to instantiate. So, each Page_Load() can pass the global.asax LXFramework object to the required object instantation New() event and then oApp would exist at that level (which is the LXFramework parameter received).
>
>So, there is no code in ASPX file except the form designer, if one would consider that. All ASPX file code behind are also empty. Everything is done in classes in the application which makes use of the framework for all framework capabilities.
>
>I read about appInstance for the scope of the global.asax framework object instantation. I don't know if this would resolve the issue. I also thought of taking a copy of the global.asax framework object in the BeginRequest() and use that instead. That would work but I would not have a reference to that copy into EndRequest() nor into an error, if one should ever happen.
Given your existing code the only way to make this work safely would to be reassign the framework references prior to every call. Something like:
>
><script runat="server">
> Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LXFramework.oRequest = Request
LXFramework.oResponse = Response
> Dim loDataEntry As DataEntryPurchase = New DataEntryPurchase(LXFramework)
> loDataEntry.GenerateForm()
> End Sub
></script>
>