kishan66
asked on
Login Control -- Password, ASP.net 2.0
Hi,
Using login control in my login.aspx page . when ever user checks "Remember me" userId is stored in cokkie.
At Next login, userID is filled automatically.
This works fine....
Now i'm trying to do the same ..for teh password .... by storing password in cookie and at next login ...fill the password ...
BUt, i am getting this error when i'm trying to fill the Login.Password filed using ...
Login2.Password = Server.HtmlEncode(Request. Cookies["p wd"].Value );
Error:- Property or indexer 'System.Web.UI.WebControls .Login.Pas sword' cannot be assigned to -- it is read only
can i accomplish what i need?
Using login control in my login.aspx page . when ever user checks "Remember me" userId is stored in cokkie.
At Next login, userID is filled automatically.
This works fine....
Now i'm trying to do the same ..for teh password .... by storing password in cookie and at next login ...fill the password ...
BUt, i am getting this error when i'm trying to fill the Login.Password filed using ...
Login2.Password = Server.HtmlEncode(Request.
Error:- Property or indexer 'System.Web.UI.WebControls
can i accomplish what i need?
ASKER
Hi Nash 2334,
Though there is no error, password is not loaded automatically. Although userid is.
When i tried to debugg using the break points , under control Login2 -> Login2.Pawword ="" & Login2.UserName = "username"
even though i'm using this line...
TextBox mypassword = (TextBox)Login2.FindContro l("Passwor d");
mypassword.Text = Server.HtmlEncode(Request. Cookies["p wd"].Value );
NO LUCK sir...
Though there is no error, password is not loaded automatically. Although userid is.
When i tried to debugg using the break points , under control Login2 -> Login2.Pawword ="" & Login2.UserName = "username"
even though i'm using this line...
TextBox mypassword = (TextBox)Login2.FindContro
mypassword.Text = Server.HtmlEncode(Request.
NO LUCK sir...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much dude.... right on the spot.
i know its not good to save cookie with password on client pc, but i will try to encrypt and save it on clients pc and decrypt to authenticate.
would appreciate if you can suggest me one method or point me to best url..
can't ask more...
i know its not good to save cookie with password on client pc, but i will try to encrypt and save it on clients pc and decrypt to authenticate.
would appreciate if you can suggest me one method or point me to best url..
can't ask more...
You can use the FormsAuthentication encrypt method. Good MSDN article here, very straightforward:
http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.encrypt.aspx
Good luck.
http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.encrypt.aspx
Good luck.
Login login = (Login)MyLoginView.FindCon
if (login != null)
TextBox passwordTextBox = (TextBox)login.FindControl
if (passwordTextBox != null)
passwordTextBox.Text = "mypassword"