Un tipico problema cuando desarrollamos formularios .Net (WebForm) es cuando tenemos que manipular campos y entre ellos hay campos tipo contraseña.
Por ejemplo:
Si tenemos un formulario que solicita Usuario, Contraseña, Confirmacion de contraseña, Nombre, Apellidos, Correo electrónico y Fecha de Nacimiento y necesitamos validar algun dato (Por lo general .Net para validar el dato recarga la pantalla) , el problema que encontramos al momento de recargar la pantalla es que las contraseñas que solicitamos se borran por lo tanto el usuario (internauta) que esta capturando información necesita capturar los datos correctamente y escribir nuevamente la contraseña y la confirmacion de la contraseña (Que chafa, no?).
Este problema lo justifican en .Net que es por seguridad, para los que desarrollamos sofware ya sabemos como se las gasta Microsoft, no?
¿Que podemos hacer?
Pues hay un truco sencillo, en el metodo Page_Load del code behind coloca el siguiente codigo:
string newPassword = this.txtNewPassword.Text; //obtiene el valor capturado en el campo contraseña
this.txtNewPassword.Attributes.Add(”value”, newPassword); //el valor capturado se asigna al atributo value del campo contraseña (para que no se pierda el valor)
y eso es todo!
Espero que les sirva este sugerencia.
April 17th, 2009 at 2:14 PM
Hi, Everything dynamic and very positively!
Saurooon
May 6th, 2009 at 11:32 AM
Hi, cool post. I have been wondering about this issue,so thanks for writing. I will likely be subscribing to your site. Keep up the good posts
May 25th, 2009 at 9:32 PM
magnifico brother te pasaste , hace time que queria resolverlo , groso (Y)
June 12th, 2009 at 5:56 PM
Hi, gr8 post thanks for posting. Information is useful!
June 13th, 2009 at 2:32 PM
I really like your post. Does it copyright protected?
July 6th, 2009 at 1:31 PM
I’m glad that after surfing the web for uch a long time I have found out this information. I’m really lucky.
July 16th, 2009 at 3:20 AM
Great topic. Now i can say thank you
July 17th, 2009 at 8:24 AM
Very goood!!!
August 18th, 2009 at 9:41 AM
Thanks for this
August 20th, 2009 at 11:14 PM
Hey! Muchas gracias!
August 22nd, 2009 at 8:10 AM
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
August 24th, 2009 at 6:09 AM
Thanks for the contibution!!!
September 15th, 2009 at 12:14 PM
BEST MAAAAN
THANK YOU
September 18th, 2009 at 10:43 AM
nice job men:)
September 19th, 2009 at 1:39 PM
Great site. Keep doing
September 19th, 2009 at 10:17 PM
It is the coolest site, keep so
September 22nd, 2009 at 7:50 PM
Thx
September 23rd, 2009 at 8:17 AM
thank you soooooo much for this
September 27th, 2009 at 9:15 AM
Thanks so much! I’ve looked everywhere for this! You’re amazing!
September 28th, 2009 at 6:06 AM
Thank you very much, bookmarked this website! thanks!!!!
September 29th, 2009 at 7:31 AM
Thanx man =)
September 30th, 2009 at 4:40 AM
thank you bro