Expressions
Expressions are little shortcuts that enable you to declaratively link data to objects in the page. We saw an example of an expression in Listing 13.1 when we passed in the connection string to a SqlDataSource object. The syntax is simple: <%$ prefix: value %>.Listing 13.1, the AppSettings prefix, and the Resources prefix. AppSettings works just like ConnectionStrings, in that it reads a value right out of web.config and passes it into the page. The only difference is that it looks in web.config's <appSettings> element instead of the <connectionStrings> element.The Resources prefix gets values out of resource (.resx) files. Resource files are generally used to break out the UI elements of an application to allow for easy localization. Under the hood, they're XML files, but they can be edited in Visual Studio as a simple table. Accessing the data of a particular field in the resource file is accomplished with the syntax <%$ Resources: MyResourceFile, MyKeyValue %>, where "MyResourceFile" is the name of the resource file without the .resx extension and "MyKeyValue" is the name of the field from which you want to extract a value.