WebForm (1)-IIS server, development method and simple foundation, webformiis
I. B/S and C/S
1. C/S
The C/S architecture is a typical two-layer architecture. The entire process is Client/Server, that is, the Client Server architecture, the client contains one or more programs running on the user's computer, and there are two types of servers. One is the database server, and the client accesses the data on the server through the database connection; the other is the Socket server, where the program communicates with the client program through the Socket.
Working Mode:
2. B/S
The B/S architecture is called Browser/Server, that is, the Browser/Server structure. Browser refers to a Web Browser. A very small number of transaction logic are implemented at the front end, but the main transaction logic is implemented at the server end. The Browser client, WebApp server, and DB constitute the so-called three-tier architecture. B/S architecture systems do not require special installation, only Web browsers.
Working Mode:
Ii. ASP Development Mode
Example 1: Ordering: guests-Users
(1). aspx File
To send requests to IIS, IIS is equivalent to a waiter.
Inform kitchen-IIS to inform the. NET Framework of the ASPX you want to see
Kitchen Cooking-. net Framework processes C # code on the ASPX page
Call the waiter to pick up the food-the. NET Framework sends the processed page to IIS, and IIS returns it to the user.
(2). hrml File
To request a garlic-html page, IIS can directly return the request to the user without going through the. NET Framework.
Example 2. Connect to the database and display the linked table in the form of a table in the browser
<% @ Language = "C #" %> <% @ Import NameSpace = "System. data. sqlClient "%>
Note:★<% C # code %>
★<% = %> A value is returned after the equal sign.
★<% @ %> Used to declare a language or reference a namespace
Iii. ASP. NET
ASP. NET is a general term for. net Website application development. It includes two technical methods: WebForm and MVC.
WebForm is similar to WinForm for visualized operations;
MVC is similar to Java and is used for code operations.
Note: When you use VS to debug HTML files, you can right-click the HTML code and choose View in the browser unless you use a breakpoint to test the C # code.
HTML form element review:
1. Text
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 = "" (several rows high)> </> textarea>
Hidden field: <input type = "hidden" name = "" id = "" value = ""/>
2. Button
Submit button: <input type = "submit" name = "" id = "disable =" disable "value =" "/> click To Go To The submit server address in form.
Reset button: <input type = "reset" name = "" id = "disable =" disable "value =" "/>
Normal button: <input type = "button" name = "" id = "disable =" disable "value =" "/>
Image button: <input type = "image" name = "" id = "disable =" disable "value =" "src =" image address "/>
3. Select a class
Single-choice button group: <input type = "radio" name = "" id = "" checked = "checked" value = ""/>
The value of name is used for grouping. The value is invisible and submitted to the program. checked sets the default options.
Check box group: <input type = "checkbox" name = "" id = "checked =" checked "value =" "/>
File Upload: <input type = "file" name = "" id = ">
<Label for = ""> </label>
<Label> A tag defines a tag for an input element ).
The label element does not present any special effects to users. However, it improves availability for mouse users. If you click Text in the label element, this control is triggered. That is to say, when the user selects the tag, the browser automatically redirects the focus to the form control related to the tag.
<Label> The for attribute of a tag must be the same as the id attribute of the relevant element.
Drop-down list box: <select name = "" id = "" size = "" multiple = "multiple"> ------ When size = 1, it is a menu;> 1, it is a list; multiple is a multi-choice.
<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>
Post note: 1. control properties:
● Label-BackColor and so on will eventually become something in html
● The control will eventually become an HTML element.
● UI and layout styles are still replaced by controls for special HTML + CSS Data Interaction
● The element containing the runat = "server" attribute is a control
2. The three figures tell you how the Web works (. NET changes the. php file in the image to the. aspx file)
(1) The server directly requests HTML files without applications and databases
(2) servers with Applications
(3) servers with applications and databases