javajunky
03-01-2007, 12:29 PM
Hi, I'm trying to do something with Expressions, and I'm not sure if it should work or not! I was hoping to evaluate the result of several static method calls and populate a property with the result thereof: My definition is as follows:
<object type="Index.aspx">
<property name="Test" expression="System.Environment.SpecialFolder.LocalApplicationD ata.ToString()"/>
</object>
But this fails horribly with the exception:
[NullValueInNestedPathException: Cannot initialize property or field node because its context is null.]
Is this the expected behaviour? Or have I just missed something simple [hopefully :)]
incidentally, if I replace the expression attribute's value with a string literal of the form 'foo'. Then the value of the property is correctly set to this value.
Thanks :)
<object type="Index.aspx">
<property name="Test" expression="System.Environment.SpecialFolder.LocalApplicationD ata.ToString()"/>
</object>
But this fails horribly with the exception:
[NullValueInNestedPathException: Cannot initialize property or field node because its context is null.]
Is this the expected behaviour? Or have I just missed something simple [hopefully :)]
incidentally, if I replace the expression attribute's value with a string literal of the form 'foo'. Then the value of the property is correctly set to this value.
Thanks :)