开发者

On login error, redirect to separate login page

开发者 https://www.devze.com 2023-01-13 16:57 出处:网络
I have a home page that is very design-specific, down to the pixel.It needs to have username/password/login, but I can\'t have it showing any error messages there.There is a separate standalone login

I have a home page that is very design-specific, down to the pixel. It needs to have username/password/login, but I can't have it showing any error messages there. There is a separate standalone login page that is not design-specific and can show any messages. It's using the standard Login co开发者_运维问答ntrol.

Is there an easy way to link the two so that if an error occurs on the home page the standalone page comes up with the errors? I know I can programmatically/manually handle most of this if need be.


Try tapping into the various events it raises (LoginError or maybe LoggedIn) and redirect to your error page from that event handler when an error has occurred.

HTH.


Turns out the Login control has a FailureAction property which defaults to Refresh (reload current page). You can set it to RedirectToLoginPage, which does a URL redirect with loginfailure=1. The login page then shows a generic Your login attempt was not successful. Please try again. message, instead of a specific message. Not exactly what I was looking for, but this is too easy to pass up and implement a custom solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消