더북(TheBook)

4. FrmStandardControl.aspx.cs 파일을 열고 다음과 같이 입력한다.

▼  FrmStandardControl.aspx.cs

using System;

namespace DevStandardControl
{
  public partial class FrmStandardControl : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          btnHtml.Value = "HTML 서버 컨트롤 - 버튼";
          btnServer.Text = "표준 컨트롤 - 버튼";
      }
  }
}

 

코드 숨김 파일에서는 순수 HTML에 접근할 수 없다. runat="server"를 붙인 input 요소에 대해서는 Value 속성으로 접근이 가능하다. ASP.NET 표준 컨트롤은 Text 속성을 통해 버튼의 텍스트를 변경할 수 있는 것이 특징이다.

신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.