Because Codesmith's code templates use syntax similar to asp.net, if you want to use the Codesmith template to generate ASP.net scripts, such as "<%," you have a problem, <% will be interpreted by Codesmith as Codesmith's own tag, so you need to use an escape tag instead of the tag you want to insert into the ASP.net code.
The specific approach is to use <%% to replace the <% tag in the asp.net that you want to generate.
For example, we want to generate the following ASP.net code:
<asp:formview id= "FormView1" datasourceid= "SqlDataSource1" datakeynames= "ProductID"
runat= "Server" >
<ItemTemplate>
<table>
<tr>
<td align= "right" ><b>product id:</ B></td>
<td><%# Eval ("ProductID")%></td>
</tr>
</table>
</ItemTemplate>
</asp:FormView>
You can use <%% to replace <% in a codesmith template
<asp:formview id= "FormView1" datasourceid= "SqlDataSource1" datakeynames= "ProductID"
runat= "Server" >
<ItemTemplate>
<table>
<tr>
<td align= "right" ><b>product id:</ B></td>
<td><%%# Eval ("ProductID")%></td>
</tr>
</table>
</ItemTemplate>
</asp:FormView>