Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure if I'm answering your question, but... If you can change your notation from</p> <pre><code>{tokenname} </code></pre> <p>to something like</p> <pre><code>&lt;%$ ZeusExpression:tokenname %&gt; </code></pre> <p>you could consider creating your <a href="http://msdn.microsoft.com/en-us/library/system.web.compilation.expressionbuilder.aspx" rel="nofollow noreferrer">System.Web.Compilation.ExpressionBuilder</a>.</p> <p>After reading your comment...</p> <p>There are other ways of getting access to the current page using ExpressionBuilder: just... create an expression. ;-) Changing just a bit the sample from MSDN and supposing the code of your pages contain a method like this</p> <pre><code>public object GetData(string token); </code></pre> <p>you could implement something like this</p> <pre><code>public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context) { Type type1 = entry.DeclaringType; PropertyDescriptor descriptor1 = TypeDescriptor.GetProperties(type1)[entry.PropertyInfo.Name]; CodeExpression[] expressionArray1 = new CodeExpression[1]; expressionArray1[0] = new CodePrimitiveExpression(entry.Expression.Trim()); return new CodeCastExpression( descriptor1.PropertyType, new CodeMethodInvokeExpression( new CodeThisReferenceExpression(), "GetData", expressionArray1)); } </code></pre> <p>This replaces your placeholder with a call like this</p> <pre><code>(string)this.GetData("tokenname"); </code></pre> <p>Of course you can elaborate much more on this, perhaps using a "utility method" to simplify and "protect" access to data (access to properties, no special method involved, error handling, etc.).</p> <p>Something that replaces instead with (e.g.)</p> <pre><code>(string)Utilities.GetData(this, "tokenname"); </code></pre> <p>Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload