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.
Operating mode:
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.
Operating mode:
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 framework of the ASPX that the user wants to see
Kitchen cooking-the. NET Framework performs processing of C # code in ASPX pages
Shouted the waiter to serve the dishes-. NET Framework to return the processed pages to the Iis,iis to the user.
(2). html file
To head Garlic-HTML page requests, IIS can be returned directly to the user without having to go through. NET Framework Processing
Example 2, connect the database, display the linked table in the form of a table on the browser
<%@ language= "C #"%><%@ Import namespace= "System.Data.SqlClient"%>
Note : ★<% C # code%>
★<%= returns a value after the%> equals sign
★<%@%> for declaring a language or referencing a namespace
Iii. ASP.
ASP. NET is a generic term for the Web Development site application, including WebForm and MVC two technical methods
WebForm similar to WinForm, visual operation;
MVC is similar to Java, with multiple code operations.
Note : When using vs debugging HTML files, unless you use breakpoints to test C # code, you do not need to use startup, you can right-click on the HTML code, choose to view in the browser.
WebForm Development Method:
XML-Extensible Markup Language
HTML-Hypertext Markup Language
New:
New in VS, this is not a project selection, but a site selection
Run:
Click the Start button:
Benefits: Can card breakpoints
Cons: Very slow start-up
Right-click on the HTML to view in the browser:
Benefits: Very fast start-up
Cons: Unable to snap breakpoints
Iv. delegate writing of events:
In the Page_Load event
Button1.Click + = button1_click;//Add button
Note: HTTP has a stateless nature, that is, when each commit causes the page to refresh, or the user refreshes themselves, will reopen a new page, the new page regardless of the previous page is the same, no
Have any relationship.
So, if you just want to execute some code the first time the page loads, you need the IsPostBack property: Returns the bool type, whether it is loaded as a commit, or false when the page is loaded for the first time
Surface
if (IsPostBack = = False)
{
95% of the code in the Load event is written in this case, except for the delegate click event!
}
Three-layer structure:
The three-tier structure in the Web is relatively clear
Interface layer is HTML, CSS, JS code
The business Logic layer is C # code
The data access layer is the ADO
HTML Form Elements review:
1. Text class
Text box: <input type= "text" name= "" id= "" value= ""/>
Password box: <input type= "password" name= "" id= "" value= ""/>
Text box: <textaarea name= "" id= "" cols= "" (Number of characters) rows= "" (a few lines high) ></>textarea>
Hidden fields: <input type= "hidden" name= "" id= "" value= ""/>
2. Button class
Submit button: <input type= "Submit" Name= "id=" "disable=" Disable "value=" "/> Click to go to the submission server address in form
Reset button: <input type= "reset" name= "" id= "" disable= "Disable" value= ""/>
Normal button: <input type= "button" name= "" id= "" disable= "Disable" value= ""/>
Picture button: <input type= "image" Name= "" id= "" disable= "Disable" value= "" src= "Picture address"/>
3. Select Class
radio button group: <input type= "Radio" name= "" id= "" checked= "Checked" value= ""/>
The value of name is used to group; value is not visible, used to submit to program; checked, set default options
check box group: <input type= "checkbox" Name= "id=" "checked=" Checked "value=" "/>
File Upload: <input type= "file" name= "id=" ">
<label for= "" ></label>
The <label> tag defines the callout (tag) for the INPUT element.
The label element does not present any special effects to the user. However, it improves usability for the user of the mouse. This control is triggered if you tap text inside a LABEL element. That is, when the user selects the label, the browser automatically shifts the focus to the label-related form controls.
The For property of the <label> tag should be the same as the ID property of the related element
Drop-down list box: <select name = "id=" "size=" "multiple=" multiple ">------size=1, for menu; >1 for list; multiple for multiple selection.
<option value= "value" > Content 1</option>
<option value= "Value" selected= "selected" > Content 2</option>------seleted, set as Default
<option value= "value" > Content 3</option>
</select>
after note : 1, Control properties:
Label-backcolor and so on will eventually become something in HTML.
The control will eventually become an HTML element
Interface, layout styles are still used HTML+CSS special data interactions require controls to replace
The element that contains the runat= "Server" property is a control
2. Three graphs tell you how the Web works (. NET is the same, the. php file in the picture becomes an. aspx file)
(1) The server does not have the application and the database, requests the HTML file directly
(2) Server with application
(3) Server with application and database
3. 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-i→ Enter to start installation after the path appears
Webform--iis servers, development methods and simple basics