[ExpressionPrefix("Code")]
public class CodeExpressionBuilder : ExpressionBuilder {
public override CodeExpression GetCodeExpression(BoundPropertyEntry entry,
object parsedData, ExpressionBuilderContext context) {
return new CodeSnippetExpression(entry.Expression);
}
}
<compilation debug="true">
<expressionBuilders>
<add expressionPrefix="Code" type="Infinity.Web.Compilation.CodeExpressionBuilder"/>
</expressionBuilders>
</compilation>
And to see it in action:
<asp:CheckBox id="chk1" runat="server" Text="<%$ Code: DateTime.Now %>" />
No comments:
Post a Comment