# .cs 파일이란?
C# 언어로 작성된 파일을 의미한다.
# aspx 파일과 aspx.cs 파일의 차이
ASPX files usually will have the UI and will which is usually HTML tags, some ASP.NET server control embed code (which ultimately produce some HTML markups). ASPX.CS file (usually called the codebehind) will have server-side coding in C#.
Aspx 파일은 화면 UI, HTML 태그와 같은 View를 담당하고, 추가로 ASP.NET 서버 컨트롤을 임베딩한 코드를 사용할 수 있다.( HTML 코드를 생성하는..?)
Aspx.cs 파일은 codebehind라고 불리며, 서버사이드 코드를 가지고 있다.
.aspx is your markup file. Contains things such as HTML, CSS, JavaScript, and ASP markup.
Generally aspx is run on the client side while the code behind is executed on the server.
aspx 파일은 HTML, CSS, JavaScript, and ASP markup로 구성되어 있다.
aspx 파일은 Client 단에서, aspx.cs 파일은 Server 단에서 실행된다.
I would relate ASPX page to View and ASPX.CS to Controller action methods.
Aspx 파일은 View에 Aspx.cs 파일은 Controller Action 방법과 연관되어 있다.
You have to remember that in webforms, there are ASP.NET controls we will be using in the ASPX file to render some HTML. Examples are TextBox, DataGrid, etc. In MVC, there is nothing called Server control. The View will be pure, handwritten HTML.
Webfom으로 프로젝트를 생성할 경우, ASP.NET 컨트롤이 HTML 파일을 렌더링하기 위해서 ASPX 파일 내에서 사용된다.
ASP.NET 컨트롤의 종류로는 TextBox, DataGrid 등이 있다.
반면, MVC로 프로젝트를 생성할 경우, 서버 컨트롤이라고 불리는 개념이 존재하지 않고, View는 순수 HTML 상으로 표현해야 한다.
Web forms are contained in files with a ".aspx" extension; these files typically contain static (X)HTML markup, as well as markup defining server-side Web Controls and User Controls where the developers place all the rc content for the Web page. Additionally, dynamic code which runs on the server can be placed in a page within a block <% -- dynamic code -- %>, which is similar to other Web development technologies such as PHP, JSP, and ASP. With ASP.NET Framework 2.0, Microsoft introduced a new code-behind model which allows static text to remain on the .aspx page, while dynamic code remains in an .aspx.vb or .aspx.cs or .aspx.fs file (depending on the programming language used).
Webform 은 aspx파일 형식을 제공하며, 정적인 HTML 마크업 언어와 서버사이드 웹 컨트롤과 사용자 컨트롤을 정의한 마크업을 aspx 파일 내에서 사용가능하다. 추가로 서버상에서 실행되는 동적인 코드가 페이지 내에 놓일 수 있는데, <% -- dynamic code -- %> 문법을 사용하여, 가능하다.
# 일반 MVC Razor? 와 Webform의 처리
Additionally, for MVC, I would suggest using a different view model, specifically Razor, which uses .cshtml files instead of the .aspx.cs and .aspx because they are easier to follow. The reason for the change in MVC is that MVC uses the MVC pattern to abstract layers of code so that .aspx and .aspxcs are not as needed. From a personal experience, I have used both Razor and Webforms (.aspx/.aspx.cs) view models with MVC and I find Razor to be much easier to code/maintain and use
일반 MVC 프로젝트의 경우, Razor라는 다른 View Model을 사용하므오, aspx 파일 확장자가 아닌 .cshtml 확장자를 사용한다. .cshtml 파일 확장자의 경우, pure한 HTML을 사용하는 듯하다. 둘다 MVC 구조로 구현가능하다..?
# 웹 개발언어에 따른 소스파일 확장자
asp - *.asp /
asp.net(c#/vb.net) - *.aspx /
php - *.php /
jap(java) - *.jsp
...
# ASP.NET 기본 상식
- VS2005 설치시 함께 설치되는 것
- 가상 웹서버 ASP.NET
- SQL SERVER 2005 Express
- [.NET]은 XML 웹서비스 플랫폼이다.
- IIS 연동은 프로젝트때 수행한다.(학습 또는 개발 시에는 별도로 필요하지 않다.)
- IIS를 연동하지 않아도 ASP.NET프로그래밍을 사용할수있는 것은 ASP.NET Development Server에 의해 실행된다.(가상데이터사이트)
# IIS 연동 기본 프로세스?
- IIS 속성 - 문서 - 기본콘텐츠페이지 - Default.aspx/Default.htm/Default.asp/index.htm 을 지정저
- 내 기본 페이지가 무엇인지 확인하여 상대편 iis관리자에게 내 기본페이지를 추가해달라고 해야한다.
# ASP 컨트롤이란?
- [도구상자] - 컨트롤이라고 읽는다.
- 컨트롤의종류
1. 서버콘트롤 - HTML 태그를 제외한 [도구상자]의 모든 기능들
2. 클라이언트콘트롤 - HTML 태그
# Master Page란?
웹사이트에서 공통적으로 사용되는 레이아웃을 정의합니다.
- 사용자가 접근하는 쪽의 MasterPage
- 관리자가 접근하는 쪽의 MasterPage
- 보통 사용자, 관리자용 페이지 2개를 준비 한다.
# 기본 bootstrap 위치
- Web Forms(웹폼) 웹페이지 프로젝트를 실행할때 Default.aspx? 또는 Main.aspx? 라는 기본페이지가 존재한다.
# .cs 파일 내부에서 ( ex. Page_Load() ) 이벤트 만들기
1. 상위 두개 드롭다운 메뉴 상에서, 생성 가능?
[ 서버개체이벤트 ] [서버개체이벤트 키워드]
[page] -> [Load] 하면 삭제된 부분을 다시금 생성가능하다.
# 출처
c# - What is the difference between .aspx and .aspx.cs? - Stack Overflow
'[DEV] App Dev ∕ Web Front > Framework ∕ Asp.Net' 카테고리의 다른 글
[ASP.NET] 한 큐에 정리하기 (0) | 2020.12.23 |
---|---|
[ASP.NET] API 요청 : CookieContainer, HttpWebRequest, HttpWebResponse (0) | 2020.12.22 |
ASP.NET 기초 클래스 (0) | 2020.12.18 |
ASP.NET 기본 소스 구조 (0) | 2020.12.17 |
Asp.Net의 정의 & 기본 프로젝트 구조 (0) | 2020.12.17 |
최근댓글