<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
<script type="text/javascript" language="javascript">
var count=0;
function winTest()
{
 //以下这段代码我注掉了,可是他也执行了.除非把它删掉,谁能告诉我为什么
//    <%string1();%>;    
}
</script>
    <form id="form1" runat="server">
    <div>
   <%=str%>
   
        <input id="Button2" type="button" value="button" runat="server"/>
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></div>
    </form>
</body>
</html>public partial class _Default : System.Web.UI.Page 
{
    public string str = "后台变量";
    protected void Page_Load(object sender, EventArgs e)
    {
        Button1.Attributes.Add("onclick","winTest()");
        //Button2.Disabled = true;
        Button2.Attributes.Add("onclick", "winTest()");
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        TextBox1.Text = "...............................................";
    }    public void string1()
    {
        TextBox1.Text = "哈哈";
    }
}

解决方案 »

  1.   

    清理一下缓存
    1.关闭页面,重新打开
    2.关闭VS 重新打开
    3.结束W3P..进程,清理缓冲池
    4.重起IIS
    5.关闭计算机,重起。
      

  2.   

    清理一下缓存 
    1.关闭页面,重新打开 
    2.关闭VS 重新打开 
    3.结束W3P..进程,清理缓冲池 
    4.重起IIS 
    5.关闭计算机,重起。1.我关闭了页面,重新打开.
    2.VS 重新打开过.
    3.停止了任务栏下的小图标.清除了缓存.
    4.没做.
    5.没做.
      

  3.   

    我以前用express版的时候也出过问题,不仅仅是注释,连删掉都会执行。lz清缓存
      

  4.   

    //    
    这个//注释是js客户端的注释
    <%string1();%>这个是运行在服务器端的,所以不起作用
      

  5.   

    //     
    这个//注释是js客户端的注释 
    <%string1();% >这个是运行在服务器端的,所以不起作用还有这种事?
      

  6.   

    好像有专门的服务器端代码的 注释标记.  <@%   %>   好像是这个,在msdn 上找找吧.