In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to understand ASP.NET". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to understand ASP.NET".
.net FrameWork Framework
Is an application development framework whose main purpose is to provide a development model.
The two main components:
Common language runtime (Common Language Runtime) (CLR):
Provide core services such as memory management, thread management and remoting, as well as enforce strict security types to improve code security and reliability.
.net Framework Class Library:
Tightly integrated with CLR, you can use it to develop a variety of applications and services. It mainly includes console applications, Windows forms applications, WindowsPresentationFoundation (WPF) applications (a class library and a set of API to create systems that send messages between Web services and clients), ASP.net websites, Web services, Windows services, WCF-based service-oriented applications, WF workflow-enabled applications, and so on.
What is ASP.NET?
Active Server Pages (dynamic server pages, programs running in IIS)
ASP.net is a unified Web development model that uses as little code as possible to generate a variety of services necessary for enterprise-level ASP.net sites.
1. Perfect combination with Framework.
For the Framenwork framework, it has been explained at the beginning.
2. Is ASP.net compiled or interpreted?
Is compiled: 1) the ASP.net page is visited for the first time and will be compiled into Microsoft Intermediate language (MicrosoftIntermediate (intermediate) Language,MSIL). 2) before the ASP.net page is actually executed, the MSIL code will be compiled into machine language in the form of just-in-time compilation (Just-In-Time,JIT).
IIS (Internet Information Services Information Service)
Provides an integrated, reliable Web server function, and IIS support is required to run the ASP.net website.
IIS (Internet Information Service) is a Web web service component, which is used for web browsing, file transfer, news service and e-mail sending, which makes it easy to publish information on the network.
In popular terms:
IIS is a web server. Allows you to put web page files in HTML format on a computer connected to the network for others to browse. Just like Sina's website, put all its files on a computer connected to the network, set up a default directory, and we can access it by entering Sina's URL in the browser.
HTM files and XHTML files
.htm is a static web page file that does not contain any server controls and consists of html elements. When the client browses and accesses the .htm file, the IIS can be sent directly to the browser and interpreted by the browser without any processing.
XHTML (eXtensible Hyper Text Markup Language) is used instead of the HTML language. It can be recognized by all browsers and is the basis of web page generation. All dynamic web files containing ASP.net elements will eventually have to be converted to the corresponding XHTML before they can 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: one is the display interface code between the elements, including the interface definition information for the XHTML element and the server control. The other part: contains code such as event handling C#
.CSS files and CSS common sense
(Sascading StyleSheet cascading style sheets, CSS)
Why use CSS?
XHTML can limit the display format of web page elements in the browser, but the controllability is not strong. If you want to unify the style of the website, you need to change it one by one, which is not convenient, so you have CSS. CSS on the basis of XHTM, provides precise positioning and redefinition of XHTML element attributes, a CSS style can be applied to multiple web pages, so it is much more convenient to modify.
CSS common sense
It consists of a selector and a declaration.
How do we apply the CSS style to our web pages?
There are three ways to choose (different locations):
1) inline style, which is simply the Style property of the html used. This attribute can be applied to any body element.
2) Internal style, which is set in the htmlStyle property.
3) external style sheet, referencing a .css style sheet file
CSS style (priority rises in turn.)
Based on element style. Redefine the html property.
P {margin-left:25px; margin-right:25px;}
Based on the style of the class.
.intro {color: # ff0000;}
ID-based style.
# menubar {background-color:#008000;}
.js files and JavaScript common sense
JavaScript is an object-based and event-driven interpretive language developed by NetScape. As a scripting language, it can be directly embedded in html pages and can be processed by browsers without interpretation on the web server. Almost or some browsers support JavaScrip.
Main uses of JavaScrip:
Create dynamic text in XHTML.
Respond to client events.
You can read and change the contents of the XHTML element.
Validate the data before it is delivered to the server.
You can detect the visitor's browser and load the relevant page according to the detected browser type.
Used to create a Cookies.
Close the window.
Displays the time on the page.
Code location:
In the middle.
JavaScript function message () {alert ("in head")} of the element in head
Effect:
During execution, the load event is triggered and the message () function is called, which is finally displayed in the browser.
In
Code omitted.
In a separate .js file.
A separate js file is used when multiple pages call javaScript, and you can put the script file in a folder.
.XML files and XML common sense
Extensible markup language Extensible markup language
Xml files are often used to solve the problem of cross-platform data exchange, and this format has become the standard format of Internet data exchange. Compared with XHTMl, XHTML is designed to display data, while XML is used to transfer and store data.
Web.config file
The configuration file of the website is an XML format file, which is used to store configuration information. They appear in multiple files and form hierarchical relationships.
The highest-level configuration file is machine.config, which has a default installation path and stores the basic configuration information of the website, which usually does not need to be modified. The next layer is web.config, and the next layer is the web.config of the subfolder, which is the inheritance relationship, and the scope is in this folder and all its subordinates.
Features of C#:
1. The C # code runs in the environment provided by .NET Framework, and does not allow direct operation of memory, which enhances the security of the system.
2. Pointers are not recommended in C #. To use pointers, you must add the unsafe modifier and use the / unsafe parameter at compile time.
3. Unified type system. All C # types inherit from a unique root type, object.
4. Using C# can build robust applications. Garbage collection in C # automatically reclaims the memory occupied by objects that are no longer in use; exception handling; and type safety design avoids uninitialized variables and array indexes that exceed boundaries.
5. Fully support component programming. It is easy to create and use the components of these software.
Framework common namespaces
System: provides basic classes, such as the String class that provides string manipulation.
System.Configuration: provides data classes that process configuration files, such as ConnectionStringSettings classes that can get database connection strings in web.config files.
System.Data: provides access to ADO.NET classes, such as our commonly used DataSet class (which provides data caching).
System.Ling: provides classes and interfaces for querying using LINQ.
System.web: provides classes and interfaces that use browsers to communicate with the server, such as the HttpRequest class for reading clients.
System.Web.Security: provides classes that implement ASP.net security on the Web server.
System.Web.UI: provides classes and interfaces for creating the user interface of an ASP.net site, such as the Page class for each Web form.
System.Web.UI.Htmlcontrols: provides the creation of a HTML server control class on a Web forms page.
System.Web.UI.WebControls: provides a Web server control class that wears a piece on Web forms.
System.Xml.Linq: provides classes for LINQ to XML.
ASP.NET standard control
HTML server controls:
All the html tags are objectified, so that the program can directly control, resulting in a HTML control. In order to program the html control, we need to convert the XHTML control into a html server control, that is, to add: runat= "server" to the properties of the control. If it's just a html tag element, we access it in Web forms as usual, which is interpreted and executed by the browser. In order to give ASP.NET better control, there are Html controls and Html server controls.
Web server controls:
Do not correspond to the elements of XHTML, you can describe the appearance, operation, and behavior of the elements, and then it is up to ASP.NET to determine how to output the page.
After watching the video of the teacher's ASP.net control, we probably know that the Web server control can be divided into:
Standard controls: commonly used controls in addition to forms (forms can also be seen as special controls), such as buttons, text box drop-down boxes, calendars for use classes, and so on.
Data controls: connect to the database and display the data in the data, etc. GridViewDataList et al.
Validation control: controls the input of user information.
Navigation controls: used for site navigation. TreeView Menu et al.
Login controls: for website user registration, user management, etc.
WebParts control: website entrance, customized user interface.
AJAXExtensions control: used to update partial information of the page without going back and forth to the entire page.
User-defined controls: expand the function of the system and maintain some uniform style of the website.
Compare:
The HTML control takes up less resources, but cannot interact with the background. If you want to interact, you have to turn to a HTML server control. When compiling, Web server controls need to be "translated" into HTML controls and then transmitted to browsers, which consumes more server resources.
Thank you for your reading, the above is the content of "how to understand ASP.NET", after the study of this article, I believe you have a deeper understanding of how to understand ASP.NET, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.