页面正常运行,后来我加了一段脚本就提示这样一个错误,以前也有过这种问题,请大家帮我分析一下:
我加的脚本就是onTextChanged后面那些
Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1026: 应输入 )Source Error: Line 33:  <asp:Label id=Label1 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.EmployeeID") %>'>
Line 34:  </asp:Label>
Line 35:  <asp:TextBox id=TextBox1 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.LastName") %>' OnTextChanged="javascript:this.parentElement.children(0).checked=true;">
Line 36:  </asp:TextBox>
Line 37:  </ItemTemplate>
 

解决方案 »

  1.   

    服务器控件是不可以像你这样加OnTextChanged="javascript:this.parentElement.children(0).checked=true;">
      

  2.   

    在ItemDataBound事件里面用FindControl找到TextBox1
    TextBox txt1=(TextBox)e.Item.FindControl("TextBox1");
    txt1.Attributes.Add("OnTextChanged","javascript:this.parentElement.children(0).checked=true;");
      

  3.   

    用onchange ,不是OnTextChanged,客户端没有这事件
      

  4.   

    TextBox txt1=(TextBox)e.Item.FindControl("TextBox1");
    txt1.Attributes.Add("onchange ","javascript:this.parentElement.children(0).checked=true;");