Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 627277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:30:39+00:00 2026-05-13T19:30:39+00:00

I am migrating my application from asp.net mvc to mvc version 2 and am

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:30:39+00:00Added an answer on May 13, 2026 at 7:30 pm

    Html.ActionLink() now returns an MvcHtmlString, instead of just a string. This new class derives from IHtmlString. You cannot automatically cast from string to an IHtmlString.

    Model.HasPreviousPage ? Html.ActionLink("<<", "Index", Model.buildParams(1)) : "<<"
    

    needs to change to

    Model.HasPreviousPage ? Html.ActionLink("<<", "Index", Model.buildParams(1)) : MvcHtmlString.Create("<<")
    

    This new class will be used in ASP.NET 4 to make “smart” use of the new ASP escape operator.

    <%: Html.ActionLink("My Link", "Action", "Controller") %> <!-- knows to not HTML-escape, because ActionLink is an IHtmlString -->
    <%: Model.FirstName %> <!-- short hand notation for <%= Html.Escape(Model.FirstName) %> -->
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm migrating an application from ColdFusion to ASP.Net MVC and have a little problem
I am migrating an application from ASP.NET Web Forms to ASP.NET MVC 3. One
We are migrating a web application from ASP.NET webforms to MVC. We understand when
I recently migrating my ASP.Net MVC 1 application from VS.Net 2008 / C# 3.5
I have the following project solution: There is a ASP.NET MVC Web Application where
does anyone have good links or tips on best practices concerning migrating from ASP.NET
I am migrating application from JSF1.2/MyFaces+Facelets TO JSF2.1/MyFaces. I have following template which used
I am migrating a MonoRail application to ASP.NET MVC and I was wondering if
I'm evaluating a migration from a classic ASP 3.0 application to ASP.NET MVC. I've
I am migrating a web application (WebForms) from ASP.NET 3.5 on IIS6 to ASP.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.