Last post Dec 28, 2007 02:15 PM by kem06.net
Dec 26, 2007 02:02 PM|kem06.net|LINK
I just want to clean a Label's text and visibility after i entered( or maybe typed any single character) into textbox. I used TextChanged event of the TextBox, however it didn't clean the text although i wrote label1.text=""; in the event TextChanged and
set AutoPostBack of TextBox to true.
And similarly, CheckedChanged event of my CheckBoxes is not working aswell. I am using .NET 2.0.
How could i handle this?
textbox Control ontextchanged checkbox CheckedChanged
Dec 26, 2007 02:15 PM|jdingo|LINK
try setting the text to "" in the Page_Load event rather than your event handler and checking for post back...
lbl.Text = "";
Dec 26, 2007 02:30 PM|pixelsyndicate|LINK
The TextBox event TextChanged will only be triggered if ALL the following takes place:
1. Textbox.AutoPostBack = True
2. TextBox.EnableViewState = True
2. TextBox.Text has changed
3. TextBox loses focus (tabbing or clicking elsewhere on the page)
Likewise, the Checkbox needs to have AutoPostBack set to True and viewstate must be enabled for this control. No need to change focus however.
Dec 28, 2007 02:15 PM|kem06.net|LINK
Thanks for replies.