I am using below line of code in my DWT.

    <a tridion:href="@@Component.ID@@">

When I visit website it shows me string <%=Html.ServerDecode("@@Component.Fields.Name@@")%> as it is because it's become Linktext property and is treated as a string rather than .net server side code. Can someone suggest me the solution?

  • Is it resolved? – Raj Kumar Jun 9 '14 at 5:34
  • Yes, it's got resolved as per suggestion given by archit. – Chakresh Singh Jun 10 '14 at 6:27

Try using the following code snippet in your DWT

    <a tridion:href="@@Component.ID@@">@@HTMLDecode(Component.Fields.Name)@@</a>;
| improve this answer | |

There seems another issue with your dwt, @@Component.Fields.Name@@ should have been resolved to component name after publishing.

When page is publish this anchor tag will be converted to

<tag attr2="" atr1="" >

and all special characters like "<" are encoded, so server code will never execute, just print on the page

You can use C# fragment/tbb

  • in c# code do the encoding, push in package.
  • get the value from package and include wherever required.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.