Hello,
If you are trying to resolve macros in aspx templates you need to use a different approach or else the macro wont be resolved. I tested a code which will return what you want so please take a look at it and adjust it to your needs.
Here is an example which displays the macro result in a label:
<script runat="server">
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
lbl1.Text = CMS.CMSHelper.CMSContext.CurrentResolver.ResolveMacros("NodeID: {%NodeParentID%} ");
}
</script>
<asp:Label ID="lbl1" runat="server" Text="Label"></asp:Label>
Let me know if that works for you.
Kind regards,
Richard Sustek