我想在VS2005中实现修改后按纽变可用,用下面的程序不行,请帮忙,好久没有用了我在ASPX中写了
function ValueChanged()
{
   document.getElementById('Button2').disabled=false;
 }
在页中改了
<asp:TextBox ID="tclient" runat="server" Style="z-index: 110; left: 128px; position: absolute;
            top: 72px" Width="416px" OnTextChanged="ValueChanged();" ></asp:TextBox>错在哪儿?谢谢!

解决方案 »

  1.   

    OnTextChanged是服务器事件。
    不是客户端js的
      

  2.   

    有一个不是很标准的方法

    OnTextChanged="ValueChanged();"
    改成 
    onPropertyChange="ValueChanged()"
    就可以了可能VS会提出警告
      

  3.   

    方法1
    <asp:TextBox ID="tclient" runat="server" Style="z-index: 110; left: 128px; position: absolute; 
    top: 72px" Width="416px" OnChanged="ValueChanged();" > </asp:TextBox> 
      

  4.   

    你的操作模式是cs结构的思路,在web内可以做可是会比较麻烦,建议改成其他方式的操作模式,比如点击修改按钮才可以修改;获取直接就可以修改
      

  5.   

    上面写错了..
    方法1
    <asp:TextBox ID="tclient" runat="server" Style="z-index: 110; left: 128px; position: absolute; 
    top: 72px" Width="416px" OnChange="ValueChanged();" > </asp:TextBox> 方法2
    也可以
    <asp:TextBox ID="tclient" runat="server" Style="z-index: 110; left: 128px; position: absolute; 
    top: 72px" Width="416px" > </asp:TextBox>     protected void Page_Load(object sender, EventArgs e)
        {
           tclient.Attributes.Add("onchange", "ValueChanged()");
        }