By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,652 Members | 1,698 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,652 IT Pros & Developers. It's quick & easy.

Redirect from start page while using Forms authentication

P: 2
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(object sender, System.EventArgs e)
{
if (!IsPostBack) // or is. doesn't matter.
{
Response.Redirect(APageInYourApplication.aspx);
}
}


I also tried
Response.Redirect(APageInYourApplication.aspx,fals e);
and
Server.Execute(APageInYourApplication.aspx);

all to no avail.

The reason I'm doing this.........
The application can be configured to run either 'browser' mode or "application" 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?
Dec 8 '06 #1
Share this Question
Share on Google+
1 Reply


P: 8
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(object sender, System.EventArgs e)
{
if (!IsPostBack) // or is. doesn't matter.
{
Response.Redirect(APageInYourApplication.aspx);
}
}


I also tried
Response.Redirect(APageInYourApplication.aspx,fals e);
and
Server.Execute(APageInYourApplication.aspx);

all to no avail.

The reason I'm doing this.........
The application can be configured to run either 'browser' mode or "application" 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?
Dec 9 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.