[Transfer] What are the meanings of "AutoEventWireup", "Codebehind", and "Inherits" in the statement?

Source: Internet
Author: User

Q:
<% @ Page Language = "vb" AutoEventWireup = "false" Codebehind = "checklogin. aspx. vb" Inherits = "zcgmMIS. WebForm2" %>

What are the meanings of "AutoEventWireup", "Codebehind", and "Inherits" in the above statement?
______________________________________________________________________________________________
Answer 1:
AutoEventWireup --- indicates whether to enable page events automatically.
Codebehind --- indicates the background code file.
Inherits --- inheritance class
______________________________________________________________________________________________
Answer 2:
AutoEventWireup:
Indicates whether the events on this page are automatically connected. True if event auto-connection is enabled; otherwise, false.
Inherits:
Defines the code hidden class for page inheritance. It can be any class derived from the Page class.
Codebehind:
Name of the code-bound File

______________________________________________________________________________________________
Answer 3:
Codebehind = "PreDeliver. aspx. cs" indicates that the post code of this page is in the PreDeliver. aspx. cs file in the current directory;
AutoEventWireup = "false" indicates whether to automatically bind page events and corresponding methods. Generally, this parameter must be set to false, if it is set to true, the same event code may be called twice.
Inherits = "Issue. Pre" indicates the class in which the control is defined in the page.

Basic knowledge: AutoEventWireup attributes
The AutoEventWireup attribute determines how the event handle is connected to the control event. When AutoEventWireup is set to true, ASP. NET decides which method in the call class to respond to the events generated during user-webpage interaction. ASP. NET can call an appropriate event handle for a Web control without a proxy. For programmers, this eliminates the need to add a proxy for the event handle. It is very convenient for programmers to add code without using Visual Studio.
When Visual Studio generates An ASPX file, it sets AutoEventWireup to false because Visual Studio generates the necessary time proxy for us.
If AutoEventWireup is set to true in Visual Studio, an event handle is called twice, once through proxy, and once as a result of AutoEventWireup.

(Continued) Basic knowledge:
The runat attribute is set to "Server", indicating that the Server processes the form and generates the HTML code sent to the customer.

The same type of Web control can be mapped to different HTML elements, depending on the browser and Web space parameter settings of the client.
The Page class defines the requested webpage, which is located in the namespace of System. Web. UI. It contains the classes required to create Web-based applications and controls.
The class Page also provides the event handle and necessary objects required to create a Web-based application.
In addition to the Page class, System. Web. UI also includes the Control class. This is a base class that provides general functions for all Web controls.

How are ASPX files and post-code files used to create webpages sent to customers? First, the class WebTimeTest inherits the Page class that defines the general functions of a webpage. In addition to inheriting these features, WebTimeTest also defines some of its own features.
The post-code file defines this function, while the ASPX file defines the GUI. When a customer requests An ASPX file, the visualization section that contains the webpage (defined in the ASPX file) and the logic section that contains the webpage (defined in the Post-code file) creates a class after the scene. The new class inherits from Page.
When a webpage is requested for the first time, this class is compiled and an instance is created. This instance indicates the webpage, which creates the HTML that is sent to the customer. Components created by compiled classes are placed in the Bin directory of the project.

Once a Web page instance has been created, multiple users can use this instance to access this web page-no longer need to re-compile. The project only needs to be re-compiled after the programmer modifies the application. These changes are detected by the runtime environment and the project will be re-compiled to reflect the changed content.

Related Article

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.