블로그 이미지
Magic_kit
study 관련자료를 한곳으로 자기 개발 목적으로 재태크 재무 관리 목적으로 일상생활의 팁을 공유 하기 위하여 블로그를 개설 하였습니다.

calendar

1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28

Category

Recent Post

Recent Comment

Archive

2009. 10. 27. 02:38 .Net Project/ASP.NET 3.5 Sp1
반응형

- 개별 HTTP 요청에 대한 HTTP 관련 정보를 모두 캡슐화

   httpContext.Current 속성 : 현재 HTTP 요청에 대한 HttpContext 개체를 가져오거나 설정

 

protected void Page_Load(object sender, EventArgs e)

{

    // 화면 출력

    //[1] Page 레벨

    Response.Write("안녕<br />");

 

    //[2] Component 레벨 : 클래스(App_Code, *.DLL)

    HttpContext.Current.Response.Write("방가<br />");

    HttpContext context = HttpContext.Current;

    context.Response.Write("또봐<br />");

 

    //[3] 호출

    Msg.Show();

}


App_Code 폴더 생성 Msg.cs 클래스 파일 생성

Show() 메서드 생성

 

public static void Show()

{

            // Response.Write(), Response.Cookies[]

   HttpContext.Current.Response.Write
                      (
"
컴포넌트 레벨에서 출력<br />");

   HttpContext context = HttpContext.Current;

   context.Response.Cookies["A"].Value = "A";

   context.Response.Cookies["B"].Value = "B";

} 






반응형
posted by Magic_kit