<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    protected void btnSend_Click(Object sender, EventArgs e) {
        lblGreet.Text = "こんにちは、" + txtName.Text + "さん！";
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>こんにちは、ASP.NET</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        名前：<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
        <asp:Button ID="btnSend" runat="server" Text="送信" OnClick="btnSend_Click" /><br />
        <asp:Label ID="lblGreet" runat="server"></asp:Label></div>
    </form>
</body>
</html>
