Redirect from start page while using Forms authentication

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rouellette
    New Member
    • Dec 2006
    • 2

    Redirect from start page while using Forms authentication

    Is it possible to redirect to another page in your application from the start page BEFORE the user has been authenticated if you're using FORMS authentication? I can't seem to get it to work.

    Simple example: In your start page simply try to redirect...

    private void Page_Load(objec t sender, System.EventArg s e)
    {
    if (!IsPostBack) // or is. doesn't matter.
    {
    Response.Redire ct(APageInYourA pplication.aspx );
    }
    }


    I also tried
    Response.Redire ct(APageInYourA pplication.aspx ,false);
    and
    Server.Execute( APageInYourAppl ication.aspx);

    all to no avail.

    The reason I'm doing this.........
    The application can be configured to run either 'browser' mode or "applicatio n" mode. (both load in the browser, just in application mode I remove all the browser controls.)
    Now, you can't initiate the application without all the controls. You have to load a page first then do a window.open and specify the window parameters. So... I load a small window, window.open() to the login page then try to close the small window. Closing the small window requires the user to confirm. Can't get around that. Anyway... since the small window just does a window.open() then immediately tries to close itself, it never fully renders before asking to user to allow it to close. Therefore my "loading... " graphic never displays and the user is left staring at a blank page. So I figured, load the graphic, redirect to another page that will do the window.open() so that the first page can finish rendering and display my graphic and then close the window.

    But it seems you cannot redirect from the start page if you're using Forms authentication.

    Any ideas? Am I WAAYYY off?
  • Johny Rodriguez
    New Member
    • Dec 2006
    • 8

    #2
    Originally posted by rouellette
    Is it possible to redirect to another page in your application from the start page BEFORE the user has been authenticated if you're using FORMS authentication? I can't seem to get it to work.

    Simple example: In your start page simply try to redirect...

    private void Page_Load(objec t sender, System.EventArg s e)
    {
    if (!IsPostBack) // or is. doesn't matter.
    {
    Response.Redire ct(APageInYourA pplication.aspx );
    }
    }


    I also tried
    Response.Redire ct(APageInYourA pplication.aspx ,false);
    and
    Server.Execute( APageInYourAppl ication.aspx);

    all to no avail.

    The reason I'm doing this.........
    The application can be configured to run either 'browser' mode or "applicatio n" mode. (both load in the browser, just in application mode I remove all the browser controls.)
    Now, you can't initiate the application without all the controls. You have to load a page first then do a window.open and specify the window parameters. So... I load a small window, window.open() to the login page then try to close the small window. Closing the small window requires the user to confirm. Can't get around that. Anyway... since the small window just does a window.open() then immediately tries to close itself, it never fully renders before asking to user to allow it to close. Therefore my "loading... " graphic never displays and the user is left staring at a blank page. So I figured, load the graphic, redirect to another page that will do the window.open() so that the first page can finish rendering and display my graphic and then close the window.

    But it seems you cannot redirect from the start page if you're using Forms authentication.

    Any ideas? Am I WAAYYY off?

    If you move the window.close() into an increment or timer sequence (client side) in the popup, that should allow your popup to load before closing. The ideal place for it would be at the tail end of the process you're showing in the popup, if that is on the browser. Also the user should not have to confirm the close, that should only be for the main open page, not the popup. What is your 'dependent' set to for the popup?

    Comment

    Working...