主题:[讨论]请高手指导该程序有什么问题?
[b][color=FF0000]MyCodeBehind.cs[/color][/b]
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace WebApplication5
{
public class MyClass:System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.TextBox TextBox1;
public void Button1_Click(Object sender,EventArgs e)
{
Label1.Text="Hello, "+TextBox1.Text.ToString();
}
}
}
[b][color=FF0000]MyCodeBehind.aspx[/color][/b]
<%@ Page Language="c#" Inherits="WebApplication5.MyClass" AutoEventWireup="false" Src="MyCodeBehind.cs" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm2</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 216px; POSITION: absolute; TOP: 128px" runat="server"
Width="96px" Height="32px">Label</asp:Label>
<asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 216px; POSITION: absolute; TOP: 192px"
runat="server" Width="112px" Height="40px"></asp:TextBox>
<asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 216px; POSITION: absolute; TOP: 272px" Width="88px"
Height="40px" Text="确定" OnClick="Button1_Click" runat="server"></asp:Button>
</FONT>
</form>
</body>
</HTML>