Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Major mixup in two ASP.NET transactions
Message
From
02/09/2006 16:40:45
 
 
To
02/09/2006 16:09:04
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01150471
Message ID:
01150549
Views:
33
>>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....)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform