How to display a value in a textbox whos textmode is set to "password" in C #

Below is the code to check the username n by displaying the password via a cookie. It works great. since I want the value displayed in the password.text file to be masked, I changed the text mode of password.text to "password". as a result, the value is not passed to the text box.

how can i solve this problem?

       String cookiename = TextBox1.Text;

        //grab cookie
        HttpCookie cookie = Request.Cookies[cookiename];

        //exists?
        if (null == cookie)
        {
            Label1.Text = "cookie not found";
        }
        else 
        { 
            password.Text=cookie.Value.ToString();

        }

      

Thank you,

+1


a source to share


1 answer


TextBox2.Attributes.Add ("value", cookie.Value.ToString ());



+1


a source







All Articles