asp:CreateUserWizard 完成后重定向

发布于 2024-10-02 07:33:16 字数 617 浏览 3 评论 0原文

我有一个使用自定义 asp:CreateUserWizard 的 asp 注册页面。

注册成功完成后(例如 RegisterUser_CreatedUser),我想将用户重定向到另一个页面,无论是欢迎屏幕等...(我猜使用 Response.Redirect(URL); ) ,但我也想以某种方式弹出一个带有登录页面的新窗口。

是否可以使用此方法从外部网址弹出屏幕,或者我应该采取其他方法吗?

我确实尝试创建一个调用此 js 函数进行注册的自定义按钮:

function redirectAfterRegister() {
    Page_ClientValidate();

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

    return false;
}

此弹出窗口之所以有效,是因为它取消了单击,但问题是即使用户创建不成功,弹出窗口也始终会被调用 - 这是错误的。

非常感谢任何帮助。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沦落红尘 2024-10-09 07:33:16

问题在于,弹出窗口仅在用户实际单击外部站点时才起作用。这可以防止垃圾邮件发送者一直弹出广告。一旦在单击后调用另一个函数,它就会被认为是不友好的,因此是外部允许的。

我认为最好让用户知道注册已成功,并为他们提供导航选项。如果有什么不同的话,至少它的用户友好性,不会造成混乱。

asp:CompleteWizardStep 可用于在成功注册后进行重定向,并在需要时提供额外的导航。

祝你好运,如果您找到替代解决方案,请告诉我。

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.

小草泠泠 2024-10-09 07:33:16

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文