Summary of ASP. NET beginners

Source: Internet
Author: User

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.

  1. In-depth research on Repeater controls: Maximum Flexibility
  2. Getting started with DataList controls
  3. Exploring the operation mechanism of the DataGrid Web Control
  4. Discuss the similarity between ASP. NET data Web controls
  5. Transformation from traditional ASP to ASP. NET: Understanding controls

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.