Mark of the page in ASP. NET

Source: Internet
Author: User

The page indication mark function is used to determine what special settings do the system need when processing the aspx file? Its syntax is:

<% @ Directive attribute = Value %> For example: <% import namespace = "system. Data" %>
Note that space is required between attributes, and no space is allowed between "=.

The web forms of Asp.net now contains the following seven identifiers:
@ Page, @ control, @ import, @ registe, @ assembly, @ outputcache

@ Page: the commonly used attribute is language, for example, <% @ page Language = "VB" %>;
In addition, he can determine the character set of this page, responseencoding = gb2312;
Allow debugging: trace = true indicates that if an error is received, the error message is displayed; otherwise, the opposite is displayed;
Warning: Warnings = true indicates that ifProgramThere is something unreasonable, although it is only a warning, it is still displayed as an error, and so on. For specific applications, see ASP. NET Chinese display solutions.

@ Control is not used in the aspx file, but in the ascx file, that is, the file that supports the sub-definition control can only have one @ control identifier in an ascx file.

@ Import is the most commonly used identifier. When we use some special aspx features, we need to use this identifier to tell the compiler what we want, I already have a common logoArticleAs mentioned in, if @ import is not used, we can use the following namespaces by default)
System
System. Collections
System. Io
System. Web
System. Web. UI
System. Web. UI. htmlcontrols
System. Web. UI. webcontrols

@ Register: This ID is used when we call the pagelet of our sub-definition component in the aspx file and register this pagelet, we can use our own namespace in this aspx file.

@ Assembly refers to the additional compiler used to compile the aspx file. The usage is as follows:
<% @ Assembly src = "docname" %> SRC points to a file suffixed with Cs or VB, which will include the class in these files into the current page.

@ Outputcache. The length of time for the content of the aspx file to be retained on the server (connection ......)
<% @ Outputcache duration = "1000" %>
The cache retention time defined here is 1000 seconds.

@ WebService refers to a WebService class. The usage is as follows:
<% @ WebService Language = "language" class = "classname" %>
<A href = "http://www.gotdotnet.com/quickstart/aspplus/">
Web service type configuralling </a>

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.