views:

56

answers:

1

Hi,

I am currently trying to move from asp.net mvc 1.0 to 2.0 in an existing solution (s#arp framework). Most things seem to work fine apart from unexplainable error messages:

Compiler Error Message: CS0828: Cannot assign method group to anonymous type property

Source Error:

Line 10:             <p>
Line 11:                 [
Line 12:                 <%=Html.ActionLink("Edit", "GlobalQualitativeFeatureForm", new { Id = Model.Id })%>

Is the mvc 2.0 syntax different? This is a strongly typed view which definately gets the object.

I also seem to have to do:

<% if (Model != null) {%>
        <%= Html.Grid(Model as IEnumerable<bla.Core.Lab>)
            .Sort(ViewData["sort"] as GridSortOptions)

where before a simple:

<% if (Model != null) {%>
        <%= Html.Grid(Model)

would have been enough. I do a:

<add namespace="bla.Core"/>

in web.config though.

Any ideas? Thanks a lot.

Christian

PS:

I also get:

Compiler Error Message: CS0019: Operator '==' cannot be applied to operands of type 'method group' and 'int'

Source Error:

Line 8:      
Line 9:      <% if(Model != null) { %>
Line 10:         <% using (Model.Id == 0 ? Html.BeginForm("CreateLab", "Labs", "Post") : Html.BeginForm("UpdateLab", "Labs", "Post"))
Line 11:            { %>
Line 12: 

does this ring a bell?

+1  A: 

I found the problem. The s#arp architecture comes with two web.config files. I have overlooked the one in the Views folders and adjusted the version of asp.net mvc.

csetzkorn