前田稔(Maeda Minoru)の超初心者のプログラム入門
// hello2.cs using System; ---(1) using System.Web.UI; using System.Web.UI.WebControls; public class hello2 : Page ---(2) { public Button Button1; public TextBox TextBox1; public void Button1_Click(object sender, EventArgs e) { TextBox1.Text = "Hello ASP.NET!!"; } } |
<!-- hello2.aspx --> <%@ Page Src="hello2.cs" Inherits="hello2" %> ---(1) <html> <body> <form runat="server"> <p> <asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Click"> </asp:Button> <asp:TextBox id="TextBox1" runat="server"> </asp:TextBox> <!-- コンテンツをここに配置してください。 --> </p> </form> </body> </html> |