TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dave
NA
161
0
Having trouble with Login FailureText
Apr 7 2009 10:05 PM
I have a Login control, nested in the anonymous template of a LoginView, which I have placed in a custom user control. Not a full-on server control. Just a simple Web User Control.
I have tried to write a custom FailureText message by handling the LoginError event for the Login with the following code:
Login logCtl = ExtensionMethodHelpers.FindControlRecursive(this, "logSiteLogin") as Login;
Literal failText = ExtensionMethodHelpers.FindControlRecursive(this, "FailureText") as Literal;
failText.Text = "Your login attempt was not successful. Please try again.";
// if the user is locked out, tell them.
MembershipUser currentUser = Membership.GetUser(logCtl.UserName);
if(currentUser != null)
{
if(currentUser.IsLockedOut)
{
failText.Text = "Your account has been locked due to too many invalid login " +
"attempts. Please contact us to have your account unlocked.";
}
}
This has not worked. When I debug, it moves through and assigns the "LockedOut" error message to the FailureText Literal control. But when the page comes up, the FailureText message is still just displaying the default FailureText.
Can anyone identify the problem.
Reply
Answers (
0
)
URL Mappings not Working
Rendering time diffrence on Local and Client machine(over RDC) for .NET based Web Application