I have a textbox (txtbox1) which has some value in it. I want to empty the value of textbox. Is that possible in code behind? If yes, how?
Thanks!
Well:
txtbox1.Text = "";
should do it.
(Note that I generally prefer ""
to string.Empty
in terms of readability. Use whichever you prefer. Ignore any talk about the performance differences between them - most articles I've seen on this are out of date, and any performance difference there might be will be entirely insignificant.)
txtbox1.Text = string.Empty;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With