IIS WebForm Development Basics

Source: Internet
Author: User

WinForm is operated on a customer's computer.

WebForm is a client that operates on a non-client computer through an IP address, to an IIS server, and then to information feedback.

First, WebForm running process
(1) Need to Access database (ASPX)

The client opens the IP address, locates the server that corresponds to the IP address, and then requests the IIS server for feedback, and if the database needs to be processed, IIS makes a request to the. NETFramework. NETFramework requests the database. The database then processes the request back to the. Netframework,.netframework feedback to the IIS server, where the IIS server is feedback to the customer.
User--iis server--. net framwork--call database--. net Framwork (database processing)--IIS Server--user
(2) Display HTML static page
User Request--iis Server--user show

Write the code in a text document, and then change the suffix to HTML or aspx after completion
(1) HTML format
Writing code using HTML
(2) ASPX format
Writing code using C # and HTML
When using the C # language:
<%@ the language or reference namespace used in the%> declaration page <%@ language= "C #"%><%@ Import namespace= "System.Data.SqlClient"%>
<%%> put a bunch of code
<% =%> A field or a variable or return a data value, put such a variable value on the page.

Third, WebForm and WinForm
(1) Web-side Purpose:
The user accesses the server through a browser, the server executes all C # code and database data, and returns the result to the user's browser.
(2) Client function code Execution location: User computer execution
Web-side function code Execution location: executed on server
(3) WebForm requires IIS installation
1) Install: Control Panel--Program or function--turn Windows features on or off--internet information Service (tick)--OK

2) Let vs and IIS know each other
Vs:vs2012--visual Studio tools--vs2012 x64/x86 Compatible tool command Prompt (right-click Admin start)-After the path is present, add aspnet_regiis-i

Four, the starting state
1 Direct Boot the prompt box is OK to
Advantages: can card breakpoint; disadvantage: slow;
2 Right-click in the HTML code--View in browser
Advantages: Quick; Save to refresh the display directly.
3 delegate notation for events (delegate events to controls)
Control. Events + = press TAB twice

Five, HTTP stateless
1 Definition: A browser-issued request is a response to an object that implements the IHttpHandler interface, because the next access is not necessarily the last time the object responds,
The object that was last responded to may have been destroyed, and the value of the class variable that was written already does not exist. Therefore, the HTTP protocol is stateless, and the server does not remember what was last given to the browser.
The root cause of statelessness is that the browser and server use socket communication, and the server closes the current socket connection after the request results are returned to the browser. and the server will
Destroys the Page object after the page finishes processing.
The HTTP protocol is stateless and does not remember the last time and the page "what happened". The server does not remember what was last given to the browser, and the browser needs to remember these values (input
In value, for other values are placed in the hidden field, such as ViewState, the next time you commit to the server, so as to achieve interactive effect!
2 What the control displays by default
In the constructor
if (ispostback==false)//The page is displayed the first time it loads
{Event delegate event cannot be written}

Vi. Database Connection
(1) App_Code: Right--add--Class--OK--automatically generate App_Code;
(2) There is no namespace for entity classes and data access classes

Seven or three-tier development
1 Interface layer: HTML+CSS+JS
2 Business Logic Layer: C # code
3 Data Access layer: apo.net
Note: Manipulating control properties with Css+js
Any effects and content on the interface should be made using pure CSS and JS to create styles and effects

IIS WebForm Development Basics

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.