.cs时.aspx的后台代码,也可以在Button1_Click处添加断点调试。

解决方案 »

  1.   

    在客户端的好像不能调试,
    .aspx的服务器端代码可以通过添加断点调试。
      

  2.   

    你可以将public void Button1_Click函数的内容写在.cs文件内,即服务器端,
    这样就可以调试了。
      

  3.   

    按你的做法,你去掉下面两行试试。其它的不变
    <%@ Page language="c#" Codebehind="index.aspx.cs" AutoEventWireup="false" Inherits="hello.WebForm1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
      

  4.   

    按你的做法,去掉下面两行,其它的不变
    <%@ Page language="c#" Codebehind="index.aspx.cs" AutoEventWireup="false" Inherits="hello.WebForm1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
      

  5.   

    你用vs.net开发,不使用内容和代码应该分离。
    <SCRIPT language="C#" runat="server"></SCRIPT>
    之间的代码应该放在.aspx.cs文件中。
      

  6.   

    怎么样把一些代码放在hello.aspx中,把脚本放在hello.aspx.cs中呢
      

  7.   

    我在visual studio.net中创建项目,并在index.asp中输入以下内容
    为什么button的onServerClick不能实现???
    我是初学者,
    不知道index.aspx与index.aspx.cs该怎么用???index.aspx中的内容:<%@ Page language="c#" Codebehind="index.aspx.cs" AutoEventWireup="false" Inherits="hello.WebForm1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>hello</title>
    <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
    <meta content="C#" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <center><a>button</a>
    <hr>
    <form runat="server" ID="Form1">
    <button id="button1" onmouseover="this.style.backgroundColor='white';this.style.color='black';" style="FONT-WEIGHT: normal; FONT-SIZE: 12pt; COLOR: white; LINE-HEIGHT: normal; FONT-STYLE: normal; BACKGROUND-COLOR: black; FONT-VARIANT: normal" onmouseout="this.style.backgroundColor='black';this.style.color='white';" type="button" runat="server" onserverclick="button1_ServerClick">
    欢迎来到ASPCN.COM</button>
    </form>
    </center>
    </body>
    </HTML>index.aspx.cs中的内容:using System;
    using System.Collections;
    using System.ComponentModel;
    usi
      

  8.   

    index.aspx.cs中的内容:public void Button1_Click(object sender,EventArgs e)
    {
    Response.Redirect("http://www.aspcn.com");
    }
    为什么按钮无效?
      

  9.   

    如果要用aspx和后台的代码,则用web控件,别用html控件了。<asp:button id="button1" ......
    双击一下button 可以出现
    public void Button1_Click(object sender,EventArgs e)
    ....了如果html和代码一个页面,则没有你的第一行变为:
    <%@ Page language="c#" %>