在asp.net中如何让文本框中内容大写?
当我输入内容时就让它随着变为大写?

解决方案 »

  1.   

    function change()
        {
            var r=document.getElementById("Text1");
            
            document.getElementById("Text1").value = r.value.toLowerCase();
        } <input id="Text1" type="text" onkeyup="change();" />
    pageload()
    {textbox1.attributes.add("onkeyup","return change();");}
      

  2.   

    private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    this.TextBox1.Attributes.Add("onkeyup","this.value=this.value.toUpperCase();");
    }
      

  3.   

    function change(){
     var r=document.getElementById("TextBox1");      
     document.getElementById("Text1").value = r.value.toUpperCase();
    }
    PageLoad()
    {
      TextBox1.attributes.add("onkeyup","change();");
    }
    ---------------------------------------------------------
    我不打算跟楼上抢分,千万别误解!
      

  4.   

    oh 大写是toUpperCase 看错了啊
      

  5.   

    要看要主你的“文本框”是服务器端控件还是客户端控件啦,方法好多,Eddie005(♂) №.零零伍 (♂) 和hz890() 的方法都是可以的。顶
      

  6.   

    ucase(string),将字符串转换为大写!!