WebForm (i)--iis server, development approach and simple Foundation

Source: Internet
Author: User

A, b/S and C/s

1. C/S

c/S architecture is a typical two-tier architecture, which is Client/server, 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 accesses the server-side data through a database connection, and the server-side program communicates with the client's program through the socket on the socket server side.

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). hrml 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"%>"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></body>

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.

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 pictures tell you the web work of the original (. NET similarly, 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

WebForm (i)--iis server, development approach and simple Foundation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.