Linq Html Placeholders

Hello,

I use linq placeholders in html template:

<tr>
    <td>&lt;&lt;foreach [item in ProductTable]&gt;&gt;&lt;&lt;[item.Id]&gt;&gt;</td>
    <td>&lt;&lt;[item.Name]&gt;&gt;</td>
    <td>&lt;&lt;[item.Price]&gt;&gt;</td>
    <td>&lt;&lt;[item.Count]&gt;&gt;</td>
    <td>&lt;&lt;[item.Count * item.Price]&gt;&gt;</td>
    <td>&lt;&lt;[item.Date]&gt;&gt;&lt;&lt;/foreach&gt;&gt;</td>
</tr>

Is it possible to replace ‘& lt;’ to something more readable?

Thanks!

@rubcs,

Thanks for your inquiry. You are using LINQ Reporting syntax in HTML. In this case, you need to use the “& lt;” and “& gt;” as you are using. When you import this HTML into Aspose.Words DOM, it will be treated as proper LINQ Reporting syntax.

Hi,

I want to share.
I found a workaround for this ticket: put “space” symbol after symbols “<<”. It’s works! Example:

<table>
    <tr>
        <td><b>Id</b></td>
        <td><b>Name</b></td>
        <td><b>Price</b></td>
        <td><b>Count</b></td>
        <td><b>Total</b></td>
        <td><b>Date</b></td>
    </tr>
    <tr>
        <td><< foreach [item in ProductTable]>><<[item.Id]>></td>
        <td><< if[item.Id > 50]>>AAAAA << else>>BBBBB << /if>><<[item.Name]>></td>
        <td><<[item.Price]>></td>
        <td><<[item.Count]>></td>
        <td><<[item.Count * item.Price]>></td>
        <td><<[BCS.dateFormat(item.Date, "yyyyMMddHHmm")]>><< /foreach>></td>
    </tr>
</table>

Maybe someone will come in handy.

@rubcs,

Thanks for your inquiry. It is nice to hear form you that you have found the solution of your query. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.