I have created password field for new and confirm password in password mode in VB.Net, while saving textbox become empty but after updation textbox is not clear. i have used code -
txtUserProfilePassword.Attributes.Add("value", txtUserProfilePassword.Text.Trim())
txtUserProfileConfirmPassword.Attributes.Add("value", txtUserProfileConfirmPassword.Text.Trim())
after submitting i am using code like -
txtUserProfilePassword.text = ""
or
txtUserProfilePassword.text = string.empty
but still textbox are not clear....
what code i should write for this??

Iftikar HussainRank #423 · 5.9K reputationPosted Aug 5, 2013, 8:34 PM EDT
If(IsPostBack==false)
--add it
I think it will work now. if not then
After saving just remove the attribute
TextBox1.Attributes.Remove("value");
Regards,
Iftikar
Abhineet SrivastavaRank #1,890 · 783 reputationPosted Aug 5, 2013, 4:01 AM EDT
rachayita jaiswal182 reputationPosted Aug 5, 2013, 4:06 AM EDT
I din't get you. where this auto complete i have to set off??
Abhineet SrivastavaRank #1,890 · 783 reputationPosted Aug 5, 2013, 4:08 AM EDT
Riyaz AkhtarRank #2,275 · 619 reputationPosted Aug 5, 2013, 4:09 AM EDT
By the way what is the purpose to use Attribute in ur code?
rachayita jaiswal182 reputationPosted Aug 5, 2013, 4:12 AM EDT
AutoComplete property is not working, textbox is not clear after submit my page.
Abhineet SrivastavaRank #1,890 · 783 reputationPosted Aug 5, 2013, 4:17 AM EDT
Please share your piece of code.
rachayita jaiswal182 reputationPosted Aug 5, 2013, 4:17 AM EDT
for updation i am fetching password in txtUserProfilePassword textbox
i am using -
txtUserProfilePassword.Attributes.Add("value", txtUserProfilePassword.Text.Trim())
so only password is coming in textbox before it was not coming
now i am updating my data, when i am clicking on button, i am getting message like data saved but password textbox is not clearing, it should clear..
what i ll do for this?
Abhineet SrivastavaRank #1,890 · 783 reputationPosted Aug 5, 2013, 4:20 AM EDT
Abhineet SrivastavaRank #1,890 · 783 reputationPosted Aug 5, 2013, 4:31 AM EDT
txtUserProfilePassword.Attributes.Add("value", txtUserProfilePassword.Text.Trim())
Comment it And Run the application please.
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 5, 2013, 6:44 AM EDT
rachayita jaiswal182 reputationPosted Aug 5, 2013, 7:30 PM EDT
txtUserProfilePassword.Attributes.Add("value", txtUserProfilePassword.Text.Trim())
but now for updation my password is not coming in password textbox.
need help, what i will do?
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 5, 2013, 7:58 PM EDT
As per my understand, you want to display previously saved password while loading this page? Why have used to .Attributes.Add for adding the value? Please clear your requirement.
Regards,
Iftikar
rachayita jaiswal182 reputationPosted Aug 5, 2013, 8:15 PM EDT
txtUserProfilePassword.Text = grdUserProfile.SelectedRow.Cells(3).Text.Trim()
(if i will remove textmode="password" it is working otherwise not working)
rachayita jaiswal182 reputationPosted Aug 5, 2013, 10:28 PM EDT
after submitting page i have used -
TextBox1.Attributes.Remove("value");
it is working.
Thank you :)
Abhineet SrivastavaRank #1,890 · 783 reputationPosted Aug 5, 2013, 10:30 PM EDT
If( !Ispostback)
txtUserProfilePassword.Attributes.Add("value", txtUserProfilePassword.Text.Trim())
rachayita jaiswal182 reputationPosted Aug 5, 2013, 11:14 PM EDT