StudentRik
StudentRik

Reputation: 1049

Passing password in session

I am trying to set the password textbox back to the text entered before a checkbox is and has AutuoPostback.

Session["passwordText"] = txt_Password.Text;

This is on my pageLoad and then I have tried to add(below) in my CheckedChanged but it says Method Add has 2 parameters and is invoked with 1 argument? What should i include with passWord.

var passWord = Session["passwordText"].ToString();

txt_Password.Attributes.Add(passWord);

Upvotes: 0

Views: 89

Answers (1)

Igor
Igor

Reputation: 15893

txt_Password.Attributes.Add("value", passWord);

or why not

txt_Password.Text = passWord; ?

Upvotes: 2

Related Questions