Frames refresh

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • galiap
    New Member
    • Mar 2007
    • 2

    Frames refresh

    Hi all, I am a beginner at ASP.NET C# programming. I am developing my first project and I came to a problem:
    I have one default.htm and two frames in it:

    <frameset border="0" frameborder="0" framespacing="0 " cols="20%,80%">
    <frame name="left" scrolling=no src="OnlineUser s.aspx"/>
    <frame name="main" src="LogIn.aspx "/>
    </frameset>

    The "left" is static. The "main" web form is a log in form. After the user is loged in, he/she is redirected to a game form - game.aspx. Unfortunately when I refresh the default.htm , just pressing F5, the LogIn.aspx is loaded and the user should log in again.
    How could I avoid this reloading the frames?
  • hini
    New Member
    • Mar 2007
    • 23

    #2
    the best way to deal with it is to use a session variable,
    you can initiate it in global.asax.
    Code:
    session("mode") = "notloggedin" ;
    and place a code on the top of login.aspx, something like

    Code:
    if (session("mode")="loggedin")
    response.redirect ....
    and in login.aspx, if the user and pass are correct, u must add a line like
    Code:
    session("mode")="loggedin"
    I believe this is the easiest way.
    don't copy paste the code because probably it may have syntax errors.
    and the idea was not clear for you, I recommend reading about session variables.

    Comment

    Working...