views:

28

answers:

1

Hello,

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

+2  A: 

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 %>.

Anton Gogolev
@Anton Gogolev: Yes. It's said <compilation debug = "true" targetFramework="4.0">
Richard77
@Richard Then how do you use those new code nuggets? Post some code, please.
Anton Gogolev
@Anton Gogolev: Check out the edit above
Richard77