开发者

switch from asp.net mvc 1.0 -> 2.0

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜