asp:CreateUserWizard 完成后重定向
我有一个使用自定义 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题在于,弹出窗口仅在用户实际单击外部站点时才起作用。这可以防止垃圾邮件发送者一直弹出广告。一旦在单击后调用另一个函数,它就会被认为是不友好的,因此是外部允许的。
我认为最好让用户知道注册已成功,并为他们提供导航选项。如果有什么不同的话,至少它的用户友好性,不会造成混乱。
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.
为什么不使用 CreateUserWizard.ContinueDestinationPageUrl 属性以转到您的欢迎页面。然后,您可以将 JavaScript 放置在 Body 元素的 onload 事件中打开新窗口。
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.