Click here to Skip to main content
15,889,858 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a button inside the update panel & a Textbox outside the update panel. I want to clear the text of Textbox without place it inside the update panel. Please help.....
Posted

C#
String s = String.Format("javascript:document.getElementById('{0}').value='';", text_box.ClientID);
ScriptManager.RegisterStartupScript(this, typeof(string), "test", s, true);
 
Share this answer
 
Comments
huzaifa.osman 29-Sep-10 8:05am    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
huzaifa.osman 29-Sep-10 8:05am    
Thank you very much! It's working.........
<input type="button" onclick="test();" id="btn1"/>

write the following in javascript

function test()
{
document.getElementById("text_box_name").value="";
}
 
Share this answer
 
v2

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