>>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>
>>>
>
>I don't understand how this would be different than the actual setup in global.asax. Is it because in the Page_Load() event, getting Request and Response would make sure that this is proprietary to the current hit as oppose to the global.asax where Request and Response could come from a simultaneous hit?
Yes. When Page_Load fires there's no quarantee that the application level BeginReguest() hasn't already reassigned LXFramework.oRequest to a new request.
If that is the case, then this would be the updated BeginRequest() event in the global.asax:
>
>
> Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
> LXFramework.oServer = Server
> LXFramework.BeginRequest()
> End Sub
>
>
>But, LXFramework.BeginRequest() method needs to have a reference to Request and Response. So, that wouldn't do as this would then be only available in the Page_Load() event.
You'd still need
LXFramework.oRequest = Request
LXFramework.oResponse = Response
My point is that these properties would need to be reset *every time* prior to referencing the LXFramework object. And I'm not even sure that would be reliable without some thread safety mechanism....
Regards,
Viv
(P.S Shutting down now I'm afraid, pub time is calling....)