<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="javascript:TestLen()"></asp:TextBox>错误提示: CS1026: 应输入 )全部代码为:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JavaScript.aspx.cs" Inherits="TestJavaScript.JavaScript" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">
<title></title>
</head>
<body>
<script language="javascript" type="text/javascript">
function TestLen() {
alert("Hello");
}
</script>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="javascript:TestLen()"></asp:TextBox>
</div>
</form>
</body>
</html>
JavaScript控件
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JavaScript.aspx.cs" Inherits="TestJavaScript.JavaScript" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">
<title></title>
</head>
<body>
<script language="javascript" type="text/javascript">
function TestLen() {
alert("Hello");
}
</script>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="javascript:TestLen()"></asp:TextBox>
</div>
</form>
</body>
</html>
JavaScript控件
解决方案 »
- 高手请进,dreamweaver vs2008同调一个JS不兼容,vs2008里,用IE8浏览也没问题,IE6就不行了
- 传值的问题
- 请教大家,windows 2003 smtp如何设置?
- 还真奇怪!为什么一些有些名气的网站都不用服务器控件(.net程序)
- c# 如何直到wms服务正常
- 在线等:问什么在vbscript中自动换行???
- 插入中文内容时,为何变成乱码呢?
- 关于vs.net 2003 升级到vs.net2005后,treeview 不能正常显示的问题。
- 为什么数据更新,没有提示错误,可更新后,打开数据库,发现数据没有被更新!
- 报表宽度怎么样设置啊?有图
- 如何在每个ItemTemplate中加载js?
- asp.net中在一个字符串中判断包含在里面的数字位置
protected void TextBox1_TextChanged(Object sender,EventArgs e)
{}如果你要写客户端时间,那就写成 onchange="javascript:TestLen()"