Click here to Skip to main content
15,914,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am using UserControl for searching(like google) purpouse.
In this i am using TextBox and Listview, Depending on TextBox
Value i am searching items in the listview.

Problem:
Depending on UserControl textbox value I am saving related data into database.
Once records are saved.I need to clear text in the TextBox .
Posted

Try to run given code after successful execution of saving data command.
XML
foreach(TextBox textbox in this.Controls.OfType<TextBox>())
{
   textbox.Text = string.Empty;
}
 
Share this answer
 
Implement a property in the User control that sets the text box value.
Then, use it to clear the value in the main app.
 
Share this answer
 
Comments
vempadu 26-Dec-11 8:23am    
thanks for reply
how to set our own property to usercontrol...........If possible Explain Once
After save the record you can empty your text box
TextBox1.Text="";
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900