在源里怎么添加下面的代码 想在按键的客户端(好像是用onclientclick)添加下面两句,不知道要怎么加 document.getElementById('TextBox1').value=""; document.getElementById('TextBox1').focus(); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个是javascript吧!对这个实在不怎么了解!就拿我们asp.net来说一般都是在设计页面双击要添加代码的控件。然后就到添加代码的地方了!你说的是源里添加吗!?这个好象还真不怎么知道!呵呵! 2005直接加就可以了<asp:Button runat="server" ID="btnok" OnClientClick="document.getElementById('TextBox1').value=""; document.getElementById('TextBox1').focus();" />或者:btnok.Attributes.Add("onclick", "document.getElementById('TextBox1').value=\"\"; document.getElementById('TextBox1').focus();"); 最好写一个js方法function aa(){document.getElementById('TextBox1').value=""; document.getElementById('TextBox1').focus();}OnClientClick="aa();" function aa(){ document.getElementById('TextBox1').value=""; document.getElementById('TextBox1').focus(); } OnClientClick="aa();" GritView 提个问题?关于用户id gridview中复选框分页复选问题 前台代码控制问题,真的不知道怎么弄!! 求教:ASP.NET中如何使用msgbox??? 在asp.net中连接Oracle数据库的问题,麻烦解决..... 再问:为什么在复合控件CreateChildControls()里创建的子控件对不齐?!!! 各位帮帮忙,关于文件路径的正则表达式 请大家帮忙看一下,这个问题难道真的没有办法解决吗?...................... 超奇怪问题,大虾指点,解决不了就当散分了 关于开放接口的问题 急救!!!!!!sql 错误
对这个实在不怎么了解!
就拿我们asp.net来说一般都是在设计页面双击要添加代码的控件。然后就到添加代码的地方了!
你说的是源里添加吗!?
这个好象还真不怎么知道!
呵呵!
<asp:Button runat="server" ID="btnok" OnClientClick="document.getElementById('TextBox1').value=""; document.getElementById('TextBox1').focus();" />或者:
btnok.Attributes.Add("onclick", "document.getElementById('TextBox1').value=\"\"; document.getElementById('TextBox1').focus();");
document.getElementById('TextBox1').value="";
document.getElementById('TextBox1').focus();
}
OnClientClick="aa();"
document.getElementById('TextBox1').value="";
document.getElementById('TextBox1').focus();
}
OnClientClick="aa();"