ASP. NET preparation knowledge learning notes, asp.net learning notes

Source: Internet
Author: User

ASP. NET preparation knowledge learning notes, asp.net learning notes

. NET FrameWork

Is an application development framework designed to provide a development model.
There are two main components:
Common Language Runtime (CLR ):
Provides core services such as memory management, thread management, and remote processing, and enforces strict security types to improve code security and reliability.
. NET Framework Class Library:
It is tightly integrated with CLR and can be used to develop multiple applications and services. It mainly includes console applications, Windows Forms applications, WindowsPresentationFoundation (WPF) Applications (a class library and a set of APIs used to create a system for sending messages between Web Services and clients), ASP.net websites, Web services, Windows Services, WCF-based service-oriented applications, and WF-enabled workflow applications.
What is ASP. NET?

Active Server Pages (Dynamic Server Pages, programs running in IIS)
ASP.net is a unified Web development model that can use as few code as possible to generate various services required for enterprise-level ASP.net websites.
1. Perfect Combination with Framework.
The Framenwork framework has been explained at the beginning.
2. Is ASP.net compiled or interpreted?
Is a compilation type: 1) when the ASP.net web page is accessed for the first time, it will be compiled into Microsoft intermediate Language (MSIL ). 2) before the ASP.net page is actually executed, MSIL code will be compiled into machine language In the form of Just-In-Time (JIT.


IIS (Internet Information Services)

Provides integrated and reliable Web server functions. IIS is required to run the ASP.net website.
IIS (Internet Information Service) is a Web page service component used for Webpage Browsing, file transmission, news services, and mail sending, making it easy to publish information on the network.
In layman's terms:
IIS is a web server. You can place HTML-format webpage files on a computer connected to the Internet for browsing by others. Just like the Sina website, put all its files on a computer connected to the network and set a default directory. We only need to enter the Sina website in the browser, you can access it.

HTM and XHTML files

. Htm is a static webpage file that does not contain any server controls and consists of html elements. When the client browses the cmd.htm file, IIS can be directly sent to the browser for explanation and execution without any processing.
XHTML (eXtensible Hyper Text Markup Language) is used to replace the HTML Language. It can be recognized by all browsers and is the basis for web page generation. All dynamic web page files containing the ASP.net element must be converted to the corresponding XHTML to be recognized by the browser.
. Aspx File

. Aspx file, as a fully object-oriented System, web forms directly or indirectly inherit the System. Web. UI. Page class.
Each Web form consists of two parts: the display interface code between <body> elements, including the interface definition information of XHTML elements and server controls. Another part: Contains code such as event processing C #.
. CSS files and CSS knowledge

(Sascading StyleSheet Cascading Style Sheet, CSS)
Why CSS?
XHTML can limit the display format of web page elements in the browser, but the control is not strong. If you want to unify the style of the website, you need to change it one by one, which is inconvenient, so CSS is available. Based on XHTM, CSS provides the ability to precisely locate and redefine the attributes of XHTML elements. a css style can act on multiple webpages, which makes it much easier to modify.
CSS common sense
It consists of a selector and a declaration.
How can we apply CSS styles on our webpage?
There are three methods available (different positions ):
1) inline styles are the html Style attributes. This attribute can be applied to any body element.
2) set the internal style in the htmlStyle attribute.
3)external table, using a. CSS style table File
CSS style (Priority increases in sequence .)
Based on element styles. Redefines html attributes.
P {margin-left: 25px; margin-right: 25px ;}
Class-based styles.
. Intro {color: # ff0000 ;}
ID-based style.
# Menubar {background-color: #008000 ;}
 
. Js files and JavaScript knowledge

JavaScript is an object-and event-driven interpreted language developed by NetScape. As a scripting language, JavaScript can be directly embedded into html pages, the browser can implement dynamic web page processing without the need for explanation on the web server side. Almost or some browsers support JavaScrip.
JavaScrip:
Create dynamic text in XHTML.
Respond to client events.
You can read and change the content of the XHTML element.
Verify the data before it is handed over to the server.
It can detect the visitor's browser and load related pages according to the browser type.
Used to create Cookies.
Close the window.
Time displayed on the page.
 
Code Location:
In
 

<Html> 

Effect:

 

When <body> is executed, the load event is triggered and the message () function is called, which is displayed in the browser.
In <body>
Code omitted.
In an independent. js file.
An independent js file is used to call javaScript on multiple pages. You can put the script file in a folder.
 
. XML file and XML common sense

Extensible markup language
Xml files are often used to exchange data across platforms. This format has become the standard format for Internet data exchange. In comparison with XHTMl, XHTML is designed to display data, while XML is used to transmit and store data.
Web. config file

The website configuration file is an XML file used to store configuration information. It appears in multiple files and forms a hierarchical relationship.
The configuration file at the highest level is machine. config, which has the default installation path and stores the basic configuration information of the website. We usually do not need to modify it. The next layer is web. config, And the next layer is the web. config of the sub-folder, which is an inheritance relationship. The scope of the role is in this folder and all its subordinates.

C # features:

1. C # code runs in the environment provided by. NET Framework, and direct memory operations are not allowed, enhancing system security.
2. Pointers are not recommended for C #. To use pointers, you must add the unsafe modifier and use the/unsafe parameter during compilation.
3. Unified Type System. All C # types inherit from a unique root type object.
4. Use C # to build robust applications. C # garbage collection automatically recycles the memory occupied by objects that are no longer used; Exception Handling; type security design avoids uninitialized variables and array indexes exceeding the boundary.
5. Fully supports component programming. It is easy to create and use components of these software.
 
Framework Common namespaces

System: provides basic classes, such as String classes that provide String operations.
System. Configuration: provides data classes for processing Configuration files. For example, you can obtain the ConnectionStringSettings class of the database connection string in the web. config file.
System. Data: provides access to the ADO. NET class, such as the DataSet class we commonly use (providing Data cache ).
System. Ling: Provides the classes and interfaces for querying using LINQ.
System. web: provides classes and interfaces for communication between the browser and the server, such as the HttpRequest class used to read the client.
System. Web. Security: provides a class for implementing ASP.net Security on the Web server.
System. Web. UI: Provides the class and interface used to create the user interface of an ASP.net website, such as the Page class of each Web form.
System. Web. UI. Htmlcontrols: allows you to create HTML server controls on the Web forms page.
System. Web. UI. WebControls: provides a Web server control class for wearing Web forms.
System. Xml. Linq: provides a class for the use of LINQ to XML.
 
ASP. NET standard controls

HTML Server Control:
 
Visualize all html tags so that the program can directly control them and create HTML controls. To program the html control, we need to convert the XHTML control into an html server control, that is, add runat = "server" to the control property ". If only html markup elements are used, the Web form access is implemented by the browser. Html controls and Html server controls appear to improve ASP. NET control.
 
Web Server Control:
It does not correspond to XHTML elements. It can describe the appearance, operation methods, and behavior of the elements, and ASP. NET determines how to output the page.
After watching the instructor's ASP.net control video, I know that Web server controls can be divided:
Standard controls: common controls, such as buttons, text box drop-down boxes, and calendar of usage classes, in addition to forms (forms can also be seen as special controls.
Data Control: connects to the database and displays data in the data. GridViewDataList.
Verification control: used to control user information input.
Navigation Control: used for website navigation. TreeView Menu, etc.
Logon control: used for Website user registration and user management.
WebParts control: website portal, Custom User Interface.
The AJAXExtensions control is used to update the partial information of a page instead of the whole page.
Custom Controls: extends system functions to maintain a uniform style of the website.
 
Comparison:

HTML controls consume less resources, but cannot interact with the background. To interact with each other, You need to convert it into an HTML Server Control. The Web server control needs to be translated into HTML control during compilation and then transmitted to the browser, which consumes server resources.

After reading this article compiled by xiaobian, do you have a rough understanding of the basic ASP. NET knowledge?

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.