The following is a summary of some questions and answers for beginners of ASP. NET, hoping to help readers who have just started to access ASP. NET.
ASP. NET newbie question 1: differences between ref and out
The ref parameter must be initialized when passed in.
The out parameter does not need to be initialized when it is passed in, but it must be guaranteed that a valid reference will be generated when it comes out.
ASP. NET newbie question 2: What is the difference between running on the stack and running on the stack?
Class, reference type and other large objects are allocated to the stack, and value types are allocated to the stack, which is highly efficient. Each process has its own stack space. c # Automatically releases the stack space when exiting the process. The heap is managed by the garbage collector.
ASP. NET newbie question 3: differences between frameset and iframe
Frameset is a framework. A webpage is divided into several parts, each of which is a different webpage file. Iframe is an embedded webpage that can be embedded anywhere on a webpage. Iframe is generally more flexible
ASP. NET beginner Question 4: differences between sprintf, wsprintf, and printf
Sprintf is used to print the ANSI character set
Wsprintf is used to print UNICODE character sets
Printf outputs to the standard device, that is, the display STDOUT
ASP. NET beginner question 5: differences between Server. transfer and response. redirect
Server. Transfer: Use the Server method to redirect users to another page.
In this solution, the server only transmits the context to another page. The advantage is that you can share page context information between pages. The disadvantage is that the user's browser does not know that the data is being transmitted, so the browser's historical records are not updated. If you refresh this page, unexpected results may occur.
Response. Redirect: redirects the user from the browser to another page.
In this solution, a command is sent to the user's browser so that the browser can obtain another page. The advantage is to update the browser's history. The disadvantage is that this scheme executes an additional round-trip process, which affects performance.
ASP. NET beginner Question 6: differences between Page. RegisterStartupScript and response. write
Page. RegisterClientScriptBlock
The script will be placed next to "</form>"
.
Page. RegisterStartupScript
The script will be placed next to the last few hidden inputs.
ASP. NET beginners 7. Differences between class and struct
The structure is the value type, and the class is the reference type.
All structure types are implicitly inherited from the class System. valueType.
Assigning a value to a schema type variable means that a "copy" of the assigned value will be created ".
The calculation of the default values of a structure is as follows: Set all value type fields to their default values, and set all reference type fields to null, so that the default values of this structure are generated.
Use the boxing and unboxing operations to convert the structure type and object.
This has different meanings for the structure.
In the structure, the instance field declaration cannot contain the variable Initial Value Setting item.
The instance constructor without parameters cannot be declared in the structure.
The Destructor cannot be declared in the structure.
- In-depth research on Repeater controls: Maximum Flexibility
- Getting started with DataList controls
- Exploring the operation mechanism of the DataGrid Web Control
- Discuss the similarity between ASP. NET data Web controls
- Transformation from traditional ASP to ASP. NET: Understanding controls