When binding text/data to a TextBox, it is done like
but, when the PostBack happens, the text shows up in the TextBox. Is there a way to still bind the data to the textbox, but not display the text in the textbox?
I have a search functionality on my website, and when someone searches I want the results page to have the textbox without the text (the searched word).
Best How To :
You've said Postback, so you're using Server side implementation, right?
If that's the case, the simplest way is to add a script that runs every page load.
For example, you have this search textbox:
<input type="textbox" id="search">
//get the attribute of the search textbox and clear the text
If you're using Ajax implementation then just add a script when your form post succeeds.