FrmTextBox (텍스트박스)
==> [FrmTextBox.aspx] 소스 및 디자인
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FrmTextBox.aspx.cs" Inherits="FrmTextBox" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Single Line :
<br />
이름 : <asp:TextBox ID="txtSingleLine" runat="server"></asp:TextBox>
<br />
<br />
MultiLine :
<br />
소개 :
<asp:TextBox ID="txtMultiLine" runat="server"
TextMode="MultiLine"
Rows="5" Columns="40"></asp:TextBox>
<br />
<br />
Password :
<br />
암호 :
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
<br />
<br />
<asp:Button ID="btnOK" runat="server" Text="확인" onclick="btnOK_Click" />
<br />
<br />
<asp:Label ID="lblDisplay" runat="server" Text=""></asp:Label>
</div>
</form>
</body>
</html>
-------------------------------------------------------------------------------------
==> [FrmTextBox.aspx.cs] 소스
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class FrmTextBox : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnOK_Click(object sender, EventArgs e)
{
// 이름
string name = txtSingleLine.Text;
// 소개
string intro = txtMultiLine.Text;
// 암호
string password = txtPassword.Text;
// 레이블에 출력
this.lblDisplay.Text = String.Format("{0}{1}{2}{1}{3}{1}", name, "<br />", intro.Replace("\r\n", "<br />"), password);
}
}
-------------------------------------------------------------------------------------
[실행결과]