如何在单击按钮时清除Ajax更新面板外部的文本框? [英] How to clear textbox outside the Ajax Update Panel on button click?
本文介绍了如何在单击按钮时清除Ajax更新面板外部的文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在更新面板中有一个按钮&更新面板外的文本框.我想清除文本框的文本而不将其放置在更新面板中.请帮助.....
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.....
推荐答案
String s = String.Format("javascript:document.getElementById('{0}').value='';", text_box.ClientID);
ScriptManager.RegisterStartupScript(this, typeof(string), "test", s, true);
<输入类型="button" onclick ="test();" id ="btn1"/>
在javascript
中写下以下内容
函数test()
{
document.getElementById("text_box_name").value =";
}
<input type="button" onclick="test();" id="btn1"/>
write the following in javascript
function test()
{
document.getElementById("text_box_name").value="";
}
这篇关于如何在单击按钮时清除Ajax更新面板外部的文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文