ASP.NET Server tags
I feel participating in technical forums is a good way to quiz one’s knowledge. I ran into a nice posting about ASP.NET server tags on ASP.NET Forums recently. Here is a quick reference of all the ASP.NET server tags with relevant links to MSDN:
- <% %> - Represents an embedded code block that executes during the page's render phase. The code in the block can execute programming statements and call functions in the current page class.
- <%= %> - Short cut for Response.Write statement.
- <%# %> - Used with data-binding expressions
- <%$ %> - The dollar sign ($) indicates to ASP.NET that an expression follows. The expression prefix (<%$ expressionPrefix: expressionValue %> ) defines the type of expression, such as AppSettings, ConnectionStrings, or Resources. Following the colon (:) is the actual expression value that ASP.NET will resolve.
- <%-- --%> - Used for Server-Side Comments.
- <%@ %> - Represents a directive block.
The ASP.NET page framework supports the following directives:
- @ Page
- @ Control
- @ Import
- @ Implements
- @ Register
- @ Assembly
- @ Master
- @ WebHandler
- @ PreviousPageType
- @ MasterType
- @ OutputCache
- @ Reference
Related reading:
ServerTagsRegex Class - Provides a regular expression to parse ASP.NET server tags.
Comments
Post a Comment