04-21-2023, 06:08 AM
(This post was last modified: 04-21-2023, 06:10 AM by Alexandre Machado.)
I see what you mean here. The problem is, putting everything in a timeline that's how it happens:
this is how the events happen in an ordered way. And that's why when you click on that button again, IW will consider the session as expired (Because it has been actually destroyed and the browser is requesting a session that doesn't exist anymore)
In order to make this scenario work you can do one of 2 things:
1) don't use sync events. Async events won't trigger PageLoad/PageUnload events
or
2) Create an empty OnAsyncPageLoaded event in that same form. You don't need to add any code to it, just create it. This way IW will trigger an event when the new page loads, terminating the "self destruct sequence"
I'm thinking about the possibility to add (2) automatically to IntraWeb logic so it will be easier to handle this scenario.
Quote:Browser Server
Click on button
OnButtonClick (this will force the page to be rendered again, causing the unload of the old "version" of the page and loading of the new one)
Page is rendered -> HTML is generated and sent to the browser
HTML received
Page unloads
OnAsyncPageUnloaded
New page loads
SelfDestruct is called
After 1 minute, IW application is destroyed
Another click
Session expired exception
this is how the events happen in an ordered way. And that's why when you click on that button again, IW will consider the session as expired (Because it has been actually destroyed and the browser is requesting a session that doesn't exist anymore)
In order to make this scenario work you can do one of 2 things:
1) don't use sync events. Async events won't trigger PageLoad/PageUnload events
or
2) Create an empty OnAsyncPageLoaded event in that same form. You don't need to add any code to it, just create it. This way IW will trigger an event when the new page loads, terminating the "self destruct sequence"
I'm thinking about the possibility to add (2) automatically to IntraWeb logic so it will be easier to handle this scenario.


