WebContainer.Close issue

I’m using a generic web container that I use to embed other web containers as sudo pages. I store the displayed embedded container in a property so that I can close it and open a new one when a user needs to go to a new “page”.

This works perfectly except when I do a “logout”. The last displayed embedded container will still be displayed (ghosted) when the user “logs in” using the same session, even though I’ve called WebContainer.close before I walked through the logout steps and show the login page. It is NOT listed in the controls for the page.

So this works fine in app:

Case "Home" Dim HomeCTR As New HomeContainer CurrentContainer.Close CurrentContainer = HomeCTR CurrentContainer.EmbedWithin(Self, GenericContainer1.Left, GenericContainer1.Top, GenericContainer1.Width, GenericContainer1.Height)

While this doesn’t:

Case "Log Off"
    CurrentContainer.Close
    Session.logOff

Where Session.logOff is :

  FrontPage.BottomDisplayBar1.Msgs.Text = "You successfully logged off."
  FrontPage.BottomDisplayBar1.LoggedInAs.text = "Guest"
  Self.LoggedIn = False
  Self.UserID = "Guest"
  Self.UserName = "Guest"
  Self.Roles = ""
  Self.Roles_Groups_IDS = ""
  
  FrontPage.Show

If I remove the FrontPage.Show, it does work. Of course, I need some way to go back to the FrontPage so the user can login again. Almost like the WebContainer needs to be refreshed before showing the FrontPage.

Any suggestions? This a bug? Workarounds if it is?

Thanks

Rather than using the implicit instance of FrontPage, perhaps using your own instance would work better?

May I ask why you are bypassing the use of WebPages?

Greg,

I have a menu bar on both the top and bottom that I do not want to replicate for every page.

So I’m putting the pages that would be displayed in to containers and displaying them in the one “master” page.

Thanks,

Steve

Hi Paul,

FrontPage is a defined page that I created in the IDE and is the page that shows when the app launches.

Is that not an explicit instance?

Thanks,

Steve

[quote=17439:@Stephen MacLean]FrontPage is a defined page that I created in the IDE and is the page that shows when the app launches.

Is that not an explicit instance?[/quote]
No. If you are referring to the page by its name in the IDE, then you are using an implicit instance.

An explicit instance is when you specifically declare an instance to it:

[quote]Dim fp As New FrontPage
fp.Show[/quote]

Ah, ok. Gotcha. I will try it out.

I’ve seen folks talking about it in other posts, saying explicit is mostly the way to go. Any specific reasons for this? Areas where you’d really want to use it vs. implicit?

Sorry, just trying to get a handle on all this.

In the meantime, I’ve worked around it by just closing the web page (Home.close) when a user logs out and then doing a FrontPage.Show.

Thanks!

Implicit instances for web pages are there for simplicity and for compatibility with desktop (which has the same concept for Windows). Once an app moves beyond something very simple, it is best to use explicit instances.