[Curiosity] Redirection not possible in WebPage.Open

Hi

This is a question out of curiosity. Why isn’t it possible to redirect to another page with WebPage.Show in a WebPage.Open event handler?
It does work in a WebPage.Shown event, why is that extra roundtrip needed?

Thanks for insights

My understanding of those two events is this: Open is the creation of the object. Shown means it’s actually reached the browser.

If I have misunderstood, I would love to know.

With this understanding, Open doesn’t necessarily mean it’s reached the browser, so you wouldn’t be able to control the browser from there.

[quote=361041:@Mathias Maes]Hi

This is a question out of curiosity. Why isn’t it possible to redirect to another page with WebPage.Show in a WebPage.Open event handler?
It does work in a WebPage.Shown event, why is that extra roundtrip needed?

Thanks for insights[/quote]
I’m curious… what’s the use case?

Well, I have a webapp that needs certain setup. So the defaultWebpage is “pageLogin”, but if the setup is not yet completed (which I can check with the existence of some files), it should show the setup page. So some pseudocode could look like this:

If setupcompleted = False Then
pageSetup.Show
End If

[quote]

My understanding of those two events is this: Open is the creation of the object. Shown means it’s actually reached the browser.

If I have misunderstood, I would love to know.

With this understanding, Open doesn’t necessarily mean it’s reached the browser, so you wouldn’t be able to control the browser from there.[/quote]

That is also my understanding, that’s why I think: Why not break off the construction of the page, and send the ‘new’ page to the browser?

Can’t you use the Session.Open Event to show the webpage?

This is indeed way better. Didn’t think of this!