Presentation is loading. Please wait.

Presentation is loading. Please wait.

Social Web Development Platform ASP.NET Razor

Similar presentations


Presentation on theme: "Social Web Development Platform ASP.NET Razor"— Presentation transcript:

1 Social Web Development Platform ASP.NET Razor
김영욱 차장 Microsoft .NET Evangelist Blog: Facebook: © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2 Social Network 소통을 위한 본능의 충족

3 SNS

4 SNS 특징 단순한 서비스 짧은 생명주기 API 기반의 서비스 트랜드의 즉시 반영 다양한 서비스와 기술과 쉬운 연결

5 What is the Razor? Razor라 쓰고 레이저라 읽는다.

6 Razor?? Laser!!!

7 DEMO Hello World Hello World & Twitter

8 ASP <> Razor 2011 1995

9 ASP.NET MVC View Engine

10 ASP.NET이 없어지는 것은 더더욱 아니다!! ASP.NET ASP.NET MVC RAZOR

11 Razor 컨셉 Small Download Simple to Learn Simple to Use
Simple to Publish Seamless integration with the Development Tool Seamless integration with other Web technologies.

12 Razor WebPages, Razor, WebMatrix

13 Razor의 구성요소 Razor: ASP.NET Razor를 위한 실행환경 WebPages: 실행에 필요한 웹페이지
WebMatrix: 개발 환경

14 WebPages ASP, ASPX와 같은 웹페이지를 구성하는 방법을 의미한다. C#의 경우 .cshtml VB의 경우 .vbhtml로 확장자가 정해진다.

15 Razor WebPages를 해석해서 실행시키는 엔진 자체를 말함 .NET 4.0 기반으로 되어 있어서
기존의 Script 기반에 비해서 뛰어난 확장성을 가지고 있음.

16 WebMatrix Razor를 사용하기 위해서 제공되는 통합 개발환경 Source Code Editor IIS Express
SQL Server Compact Edition .NET Framework 4.0

17 WPI Web Platform Installer Web Application에 필요한 개발환경
환경으로 에서 접근할 수 있다.

18 개발환경 설치하기

19 Razor Development Development Environment

20 Razor Structure

21 @ @는 Razor Code를 구별하게 해주는 구별자의 역할을 한다. Ex) @DateTime.Now
@DateTime.DaysInMonth(2010,8) @Request.Browser.Browser Sample001.cshtml

22 { } Ex) @for(var i = 10; i < 21; i++)
{ }는 코드 블럭을 표현 할 수 있다. 코드 블록 안에서도 구별이 가능하다. Ex) @for(var i = 10; i < 21; i++) { <p + "pt")"> My font size is } Sample002.cshtml

23 { } Ex) @foreach (var myItem in Request.ServerVariables)
{ }는 코드 블럭을 표현 할 수 있다. 코드 블록 안에서도 구별이 가능하다. Ex) @foreach (var myItem in Request.ServerVariables) { } Sample003.cshtml

24 IsPost Ex) IsPost를 사용해서 Post Feedback 여부를 확인 할 수 있다. if(IsPost) {
result = "Post된 페이지"; } Sample004.cshtml

25 Request 사용자로 부터 입력된 정보를 Request를 통해서 받을 수 있다. IsPost와 함께 사용하면 더 편리하게 사용할 수 있다. Ex) var num1 = Request[“text1”] Sample005.cshtml

26 Comments 주석문은 로 사용할 수 있다. Ex) @//주석문 @/* 긴문장의 주석문 */

27 Variables Dynamic type과 Static type 두 가지 형태로 사용 내부적으로는 모두 .NET 기반의 표준 데이터 타입으로 활용됨 Ex) var greeting = “welcome” int num = 100 Sample006.cshtml

28 Converting

29 Operation

30 Page Object Ex) ASP.NET에서처럼 페이지는 컨테이너 오브젝트로 존재하게 된다.
var path = Request.FilePath; var path = this.Request.FilePath; var path = this.Request.Url Sample007.cshtml

31 Collection Object Razor에서는 String 배열과 Dictionary 타입 두 가지 형태를 모두 지원한다. Ex) string[] teamMembers = {"Matt", "Joanne", "Robert", "Nancy"}; var myScores = new Dictionary<string, int>(); myScores.Add("test1", 71); Sample008.cshtml

32 Try~Catch Ex) Error Handler를 try~catch 문으로 사용할 수 있다. try {
fileContents = } catch (FileNotFoundException ex) errMsg = ex.Message; userErrMsg = “파일 오류”; Sample009.cshtml

33 Layout RenderPage( )

34 RenderPage() RenderPage( )를 이용하게 되면 이전에 include와 비슷한 효과를 낼 수 있다.
Header Footer Sample008.cshtml

35 RenderSection() RenderSection( )을 사용하면 Contents와 Layout을 분리할 수 있다.
Content pages Layout Page @Session Header RenderSection( ) @Session Body RenderSection( ) @Session Footer RenderSection( )

36 PageData[ ] Page 내에서 지속적으로 참조되는 변수를 저장하기 위해 제공 Content pages
Layout Page PageData[“key”] PageData[“key”] @Session Header RenderSection( ) @Session Body RenderSection( ) @Session Footer RenderSection( )

37 Form Validation IS~

38 Is~ Ex) Is~로 시작하는 함수들은 내용을 검증할 때 사용할 수 있다. IsEmpty( ) IsInt( ) ….
Sample010.cshtml

39 DB Programming Database Class

40 Database Microsoft SQL Server Microsoft SQL Server Compact Edition
MySQL …. Sample008.cshtml

41 Database WebMatrix를 설치하게 되면 별다른 작업이 없어도 Microsoft SQL Server Compact 버전을 사용할 수 있다. Sample008.cshtml

42 Database Database Object를 활용한다. Database.Open( ); Database.Query( );
Row Object로 결과물을 받음.

43 이제부터 필요한 건 뭐?

44 1/17/2019 6:44 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "Social Web Development Platform ASP.NET Razor"

Similar presentations


Ads by Google