A, b/S and C/s
1. C/S
C/S architecture is a typical two-tier architecture, the whole process is client/server, that is, the client server-side architecture, the client contains one or more programs running on the user's computer, and the server side has two, one is the database server side, the client through the database connection to access server-side data The other is the socket server side, and the server-side program communicates with the client through the socket. ]
WinForm WPF
2, b/S
b/S architecture is all called Browser/server, which is the browser/server structure. Browser refers to a Web browser, a very small number of transaction logic in the front-end implementation, but the main transaction logic on the server-side implementation, browser client, WebApp server-side and DB-side constitute the so-called three-tier architecture. b/S architecture system without special installation, only the Web browser can.
ASP-Web-site application development Technology
WebForm MVC
Second, ASP development mode
Example 1: à la carte: guest-user
(1). aspx file
Potato wire-To send a request to IIS, IIS is the equivalent of a waiter
Notify the kitchen-IIS informs the. NET Framwork framework of the ASPX that the user wants to see
Kitchen cooking-the. NET Framework performs processing of C # code in ASPX pages
Warehouse take potatoes-. NET Framework to SQL Server for data processing
Shouted the waiter to serve the dishes-. NET Framework to return the processed pages to the Iis,iis to the user.
(2). hrml file
To head Garlic-HTML page requests, IIS can be returned directly to the user without having to go through. NET Framework Processing
<%@ language="C #"%><%@ Import namespace="System.Data.SqlClient"%>"1"><tr><td> username </td><td> password </td><td> nickname </td><td> sex </td> <td> Birthday </td><td> National </td></tr><%SqlConnection Conn=NewSqlConnection ("server=.; Database=lianxi;user=sa;pwd=123"); SqlCommand cmd=Conn. CreateCommand (); Cmd.commandtext="SELECT * from Users"; Conn. Open (); SqlDataReader Dr=cmd. ExecuteReader (); {%><tr><td><%=dr[0]. ToString ()%></td><td><%=dr[1]. ToString ()%></td><td><%=dr[2]. ToString ()%></td><td><%=dr[3]. ToString ()%></td><td><%=dr[4]. ToString ()%></td><td><%=dr[5]. ToString ()%></td></tr><%}conn.close ();%>Table</body>Note : ★<% C # code%>
★<%= returns a value after the%> equals sign
★<%@%> for declaring a language or referencing a namespace
2. IIS Installation
(1). Install : Control Panel → programs or features → turn Windows features on or off →internet information Service (tick) → OK
(2). VS: Visual Studio tools→vs2012 x64/x86 Compatible tool command Prompt (right-click admin start) → Add aspnet_regiis after the path is present -
Third, Webform
1. Startup status
Click Start to run, but slower, compared to the HTML code on the right, click on the browser to view relatively fast, but when we need to click on the card breakpoint to start running
2. How to delegate the event
In its constructor, take Button1 as an example: button1. click+= and then press two times TAB key
3.HTTP non-state sex
Each time the event is submitted, the page will be refreshed, the Load event must be refreshed, and the case of duplicate binding occurs.
Each request is independent, its execution and results are not directly related to the previous request and subsequent requests, it will not be directly affected by the previous request response, and will not directly affect the subsequent request response situation
The solution is to write an if statement, the parentheses are written in IsPostBack = = False, to determine whether it is not the first response, 95% of the code is written in the inside, but the event delegate can not be written inside
4. Database connection
Unlike WinForm, the difference is that the WebForm entity class, the data access class has no namespace, and can be referenced directly in the code.
The other classes you create are placed in the App_Code folder, which you don't normally need to create, and you'll be prompted when you build your class.
Three-layer development of 5.Webform:
Interface layer: HTML+CSS+JS
Business Logic Layer: C #
Data Access layer: ADO
Any effects and content on the interface should be made using pure CSS and JS to create styles and effects
WebForm (ASP Development mode, IIS server, WebForm Development Foundation)