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

  • Home
  • SEARCH
  • 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 recently migrating my ASP.Net MVC 1 application from VS.Net 2008 / C# 3.5
Recently i am working on migrating the ASP.NET Web application to MVC. I am
I am migrating an application from .NET 1.1 to .NET 2.0. Should I remove
Found the following in an Oracle-based application that we're migrating (generalized) : SELECT Table1.Category1,
Migrating a project from ASP.NET 1.1 to ASP.NET 2.0 and I keep hitting this
I'm in the process of moving a large classic ASP application to ASP.NET MVC
My ASP.Net 3.5 SP 1 MVC 1.0 web application uses Resources (resx) in several
I'm migrating a quite big application from .net 2.0 to 3.5 and the first
I have an existing .net web application that creates Customer contact record in regular

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.