I'm getting Invalid expression term ":" error if I use <%:%> with VWD2010 Express
I'm getting Invalid expression term ":" error if I use <%:%> with VWD2010 Express, which I believe works with .NET4 framework. Only <%= %> or <% = Html.Encode()%> work. Is there any other configuration to apply or VWD2010 doesn't support that 开发者_运维问答syntax?
EDIT
Here's a sample code I'm using
<th><% : Html.LabelFor(x=>x.registrationData.OrganizationName) %></th>
<td><% : Model.registrationData.OrganizationName %></td>
It works only if I write it this way
<th><% = Html.LabelFor(x=>x.registrationData.OrganizationName) %></th>
<td><% = Html.Encode(Model.registrationData.OrganizationName) %></td>
Thanks for helping
Is your project configured to support ASP.NET 4.0?
<configuration>
<system.web>
<compilation targetFramework="4.0" />
</system.web>
</configuration>
And correct syntax is <%: Model.registrationData.OrganizationName %>
.
精彩评论