954,577 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem with the Login Control

Good Afternoon All

In all my Application, i used to write my login screen and i will not have a problem. i have inherited the ASP.NET Application that uses a login control.
Below are the pics of how it looks

here is a code for Forget Password link

protected void btnForgot_Click(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {

            PasswordRecovery1.Focus();

            multiviewLogin.ActiveViewIndex = 1;

            if (Login1.UserName != "")
            {
                PasswordRecovery1.UserName = Login1.UserName;
            }
        }
    }


and for Change Password code

protected void btnChangePassword_Click(object sender, EventArgs e)
    {
        ChangePassword1.Visible = true;
        if (Login1.UserName != "")
        {
            PasswordRecovery1.UserName = Login1.UserName;
        }
        
    }

Now my Problem is that when a user enters a username and password that are correct, and Click the "Forgot Password" button , it logged teh user in the system. It is doing the same thing as the "Change Password". But if i Crear the Username and Password textbox in the Login control it goes to the right place. So i have tried to crear them when the "Forgot Password Button is clicked and set them to empty strings, well for username its working, but for password i get an error that says the property is a Readonly

i tried to do them like this

if (!Page.IsPostBack)
        {
            /*Vuyiswa Added this to Prevent the Page from Bypassing the Login screen.
             * This was a bug Reporeted by University of freestate*/
            if (Login1.UserName != "")
            {

<strong>                Login1.UserName = "";

                Login1.Password = "";</strong>
            }
            PasswordRecovery1.Focus();

            multiviewLogin.ActiveViewIndex = 1;

            if (Login1.UserName != "")
            {
                PasswordRecovery1.UserName = Login1.UserName;
            }

What is the Problem

Thanks

Attachments login_Control.JPG 8.74KB
vuyiswamb
Posting Whiz
312 posts since Mar 2007
Reputation Points: 31
Solved Threads: 14
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You