0

I have an asp registration page using a custom asp:CreateUserWizard.

Once the registration is completed successfully (RegisterUser_CreatedUser for example) I want to redirect the user to another page, be it a welcome screen, etc... (using Response.Redirect(URL); I guess), but I also want to, some how, popup a new window with the login page.

Is it possible to popup a screen from an external url using this method, or is there another way I should go about it?

I did try creating a custom button which calls this js function for registration:

function redirectAfterRegister() {
    Page_ClientValidate();

    if (Page_IsValid) {
        window.open('/Account/Login.aspx?UserCreated=True');
        $('#CreateUserButton').click();
    }

    return false;
}

This popup works because its called off a click, but the problem with this is the popup is always called even if the creation of the user was unsuccessful - which is wrong.

Any help is highly appreciated.

4

2 回答 2

1

The problem is that popups only work when a user actually clicks in external sites. This prevents spammers from popping up ads all the time. Once another function is called after the click it is considered unfriendly and therefore to allowed externally.

I think it best to let the user know the registration was successful and give them navigation options from there. If anything, at least its user friendly that way, without confusion.

The asp:CompleteWizardStep can be used to redirect after successful registration, and provide extra navigation where needed.

Good Luck, and let me know if you find an alternate solution.

于 2010-11-17T18:50:56.453 回答
1

Why not use the CreateUserWizard.ContinueDestinationPageUrl property to go to your welcome page. You can then place your javascript to open a new window in the onload event of the Body element.

于 2010-11-24T20:42:24.810 回答