ASP.NET MVC 2 actionlink breaking after migration from MVC version 1
- by thermal7
Hi,
I am migrating my application from asp.net mvc to mvc version 2 and am having the following issue.
I have paging links << < that I include in each page. Like so:
<% Html.RenderPartial("PagingControl", Model); %>
They exist in an ascx file as follows.
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BankingDB.Controllers.Utility.IPagedSortedObject>" %>
<div class="paging">
<div class="previous-paging">
<!- error!! -><%= Model.HasPreviousPage ? Html.ActionLink("<<", "Index", Model.buildParams(1)) : "<<"%>
<%= Model.HasPreviousPage ? Html.ActionLink("<", "Index", Model.buildParams(Model.PreviousPageIndex)) : "<"%>
</div>
<div class="paging-details">
Showing records <%= Model.BaseRecordIndex %> to <%= Model.MaxRecordIndex %> of <%= Model.TotalRecordCount %>
</div>
<div class="next-paging">
<%= Model.HasNextPage ? Html.ActionLink(">", "Index", Model.buildParams(Model.NextPageIndex)) : ">"%>
<%= Model.HasNextPage ? Html.ActionLink(">>", "Index", Model.buildParams(Model.PageCount)) : ">>"%>
</div>
</div>
When I try to access the page I get the error:
CS0173: Type of conditional expression cannot be determined because there is no implicit conversion between 'System.Web.Mvc.MvcHtmlString' and 'string'
The error is marked above and appears to be with the action link. Including the controller name doesn't help. Any ideas?