ASP.net Expression Builders

|
Some linkage first:
Put basically, expression builders allow you to "intercept" the ASP parser before it starts actually processing server tags and thus insert code into the C# that's generated by the ASP.net markup, so you can set the values of properties in the ASP.net markup, rather than doing it in the Page_Load, or similar, method.

For example:

<asp:Literal runat="server" Text="<%$ MyExpressionBuilder: my.key.that.gets.handled %>
In a product I'm working on I'm planning on using it to implement database backed localisation for UI strings. The current solution has all pages inherit from a base page that provides an abstract "SetLocalisedStrings" method which gets called and is responsible for setting all the relevant ".Text" properties of various controls. Clunky, and it separates the localisation keys from the actual controls making it hard to match-up what goes where.

About this Entry

This page contains a single entry by Robert Wray published on May 7, 2009 8:30 AM.

How many types?!? was the previous entry in this blog.

ASP.net Expression Builders 2 - For Localisation is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 5.04