Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 11th, 2011, 06:38 AM
Authorized User
 
Join Date: Aug 2011
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Default OntextChanged Event of textbox

hi,
I am having a simple doubt about textchanged event of texbox...
When I am firing textbox event "textchanged" then it is automatically get blank...

for eg, If i enter a "emma" in the textbox and press 'enter' key then the texbox doesnt get blank.
But when i enter password character (****) into texbox and pressing 'tab' or'enter' key then it get blank auotomatically....
I want same entered password character to be in the textbox even if textchanged event is fired...

Waiting for your solution...
thanks in advance...
Reply With Quote
  #2 (permalink)  
Old August 11th, 2011, 06:54 AM
Imar's Avatar
Wrox Author
Points: 71,632, Level: 100
Points: 71,632, Level: 100 Points: 71,632, Level: 100 Points: 71,632, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,013
Thanks: 79
Thanked 1,576 Times in 1,553 Posts
Default

Can you post your code (both the HTML / ASPX markup as well as the code behind you may have)? You typically don't fire the OnTextChanged event yourself, the control fires it and you can respond to it. Maybe you're resetting something in this event?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old August 11th, 2011, 06:56 AM
Imar's Avatar
Wrox Author
Points: 71,632, Level: 100
Points: 71,632, Level: 100 Points: 71,632, Level: 100 Points: 71,632, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,013
Thanks: 79
Thanked 1,576 Times in 1,553 Posts
Default

OH, BTW, I think I see what the problem is. Password controls don't maintain their values after a postback. For more information: http://forums.asp.net/t/1267557.aspx...after+postback+

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #4 (permalink)  
Old August 11th, 2011, 07:17 AM
Authorized User
 
Join Date: Aug 2011
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Yea u are right... i m not firing the event, it is invoked automatically....
this is the CS code i m writing incide event
protected void txt_confirmPwd_TextChanged(object sender, EventArgs e)
{
if (txt_pwd.text!= txt_confirmpwd.text)
{
lbl_PwdMsg.Text = "password not matched";
}

}

BTW I guess the problem is due to same reason that you gave...
"Password controls don't maintain their values after a postback."...
thanks for your great response... :-)
Reply With Quote
  #5 (permalink)  
Old August 11th, 2011, 07:53 AM
Imar's Avatar
Wrox Author
Points: 71,632, Level: 100
Points: 71,632, Level: 100 Points: 71,632, Level: 100 Points: 71,632, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,013
Thanks: 79
Thanked 1,576 Times in 1,553 Posts
Default

On a side note, I wouldn't write this myself, but use the CompareValidator instead. Or better yet, use the CreateUserWizard if it's supported by your requirements.

Cheers.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #6 (permalink)  
Old August 12th, 2011, 12:43 AM
Authorized User
 
Join Date: Aug 2011
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Smile

Thanks Imar... I will prefer CompareValidator controll.....
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
OntextChanged event of Textbox Emma Krystal ASP.NET 4 General Discussion 0 August 11th, 2011 06:17 AM
Textbox Leave Event Jewel142 BOOK: Visual Basic 2010 Programmer's Reference 3 April 22nd, 2011 04:42 PM
Modelpopupextender on textbox keypress event swathi reddy BOOK: Beginning ASP.NET 2.0 AJAX ISBN: 978-0-470-11283-0 0 April 26th, 2010 12:47 AM
TextBox Event davewoods Visual Basic 2005 Basics 3 October 10th, 2008 12:56 PM
SOLVED -- Overriding OnTextChanged of ComboBox dparsons C# 1 January 17th, 2007 01:50 PM



All times are GMT -4. The time now is 10:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.