想在按键的客户端(好像是用onclientclick)添加下面两句,不知道要怎么加 
document.getElementById('TextBox1').value="";  
document.getElementById('TextBox1').focus();

解决方案 »

  1.   

    这个是javascript吧!
    对这个实在不怎么了解!
    就拿我们asp.net来说一般都是在设计页面双击要添加代码的控件。然后就到添加代码的地方了!
    你说的是源里添加吗!?
    这个好象还真不怎么知道!
    呵呵!
      

  2.   

    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();");
      

  3.   

    最好写一个js方法function aa(){
    document.getElementById('TextBox1').value="";  
    document.getElementById('TextBox1').focus();
    }
    OnClientClick="aa();"
      

  4.   

    function aa(){ 
    document.getElementById('TextBox1').value="";  
    document.getElementById('TextBox1').focus(); 

    OnClientClick="aa();"