Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Major mixup in two ASP.NET transactions
Message
From
03/09/2006 17:14:39
 
 
To
03/09/2006 16:56:27
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:
01150622
Views:
49
>>I guess so (but I don't know what LXFramework.BeginRequest() does). Also, within the LXFramework itself, you'd need to ensure that all references to oResponse and oRequest use the public property (rather than the underlying variable it was mapped to)
>
>Ok, but wouldn't we safer with an approach like this:
>
>
><script runat="server">
>    Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
>        Dim loApp As Framework.Framework.App = LXFramework
>        loApp.BeginRequest()
>        Dim loDataEntry As DataEntryPurchase = New DataEntryPurchase(loApp)
>        loDataEntry.GenerateForm()
>    End Sub
></script>
>
>
>This would allow me to preserve the ability to have one framework initialization done at the global.asax level. However, once the page loads, I would take a copy of that common object into loApp. I would then use loApp to pass it to my business logic object. Thus, loApp would be proprietary to the hit and could not conflict with any other hit. This assumes that loApp.BeginRequest() would make use of HttpContext.Current to initialize loApp.oRequest and loApp.oRequest.
>
>So, basically, this means the Application_BeginRequest() code section would be removed from global.asax.
>
>While this would resolve that part, I would still need to find a way to handle my Application_EndRequest() and Application_Error() code sections as those need to also rely on the current hit.
>
>I guess I could have something like this in the Page_Load to take care of the framework EndRequest() method:
>
>
><script runat="server">
>    Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
>        Dim loApp As Framework.Framework.App = LXFramework
>        loApp.BeginRequest()
>        Dim loDataEntry As DataEntryPurchase = New DataEntryPurchase(loApp)
>        loDataEntry.GenerateForm()
>        loApp.EndRequest()
>        loApp.oResponse.Write(loApp.GetJavascriptMessage)
>    End Sub
></script>
>
>
>and remove Application_EndRequest() from global.asax.
>
>The Application_Error() event would be something else however as it has to remain at the global.asax level.
>
>If that is a potential design patter to use, in my case, then I would need to find a way to sub class that as a master page.

Whoa! I think your over-complicating things. Just try my suggestion to map your framework oResponse/oRequest properties to Current.Response/Current.Request - that should be all you need to do (apart from, as you say, removing some dead wood from the current global.asax)
IAC
>        Dim loApp As Framework.Framework.App = LXFramework
>        loApp.BeginRequest()
>I would take a copy of that common object into loApp.

That's not a copy - it's just another reference to the same object...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform