Share via


Expression Handlers

ASP.NET 2.0 introduces a declarative new syntax for referencing code to substitute values into the page, called expression handlers. These are classes that at parse time evaluate expressions defined within a <%$...%> section, and with a particular prefix. Built-in expression handlers allow you to easily reference a connection string or an appSettings value saved in web.config, or retrieve a string from a resource file. ASP.NET 2.0 includes expression handlers for referencing string resources for localization, connection strings, application settings, and profile values. Using resource files and expressions, for example, you can create a Web page that displays text in different languages depending on values determined at run time. You can also write your own expression handlers to create your own custom syntax to substitute values in a page rendering.

Use the Expressions dialog box to assign substitutions to your expressions at run time