Skip to main content

ASP.NET Inline Code Syntax Reference

Rendering Code Syntax: <% %> and <%= %>

Code enclosed by <% ... %> is just executed, while expressions that include an equal sign, <%= ... %>, are evaluated and the result is emitted as content.

Data Binding Syntax: <%# %>

Code located within a <%# %> code block is only executed when the DataBind method of its parent control container is invoked.

Expression Syntax: <%$ ... %>

ASP.NET 2.0 adds a new declarative expression syntax for substituting values into a page before the page is parsed. This is useful for substituting connection string values or application settings defined in a Web.config file for server control property values. It can also be used to substitute values from a resource file for localization.

Comments