关于.NET C#中 TextChanged的问题

来源:百度知道 编辑:UC知道 时间:2024/05/22 04:33:43
protected void TextBox2_TextChanged(object sender, EventArgs e)
{
Label1.Visible =false;
}

代码很简单,就是想在TextBox2改变的时候,Label1不可视,但是Visual Studio 比较另类,改变了Text内容,下面的代码不实现,请高手指点一下。

来直接点,别给我复制一堆东东,长篇大论的。谢谢
本意是
有没有改变text的内容的同时
Label1.Visible =false; 这个就执行的....

兄弟,我帮你做好了,用js做

只用前台代码就可以了,直接复制到aspx就用了

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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>
<script type="text/javascript">
function TextChanged()
{
document.getElementById('Label1').style.display="none";
}

</script>
</head>

<body>