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 9188691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:04:28+00:00 2026-06-17T20:04:28+00:00

in asp.net mvc, I have a view with name index that show one html

  • 0

in asp.net mvc, I have a view with name index that show one html table as a grid.
suppose this is this my html table:

<table>
<tr>
    <th>
        Caption
    </th>
    <th></th>
</tr>
@foreach (var item in Model) {
<tr>
    <td>
        @Html.DisplayFor(modelItem => item.Caption)
    </td>
    <td>
        @Html.ActionLink("Edit", "Edit", new { id=item.CityId }) |
        @Html.ActionLink("Details", "Details", new { id=item.CityId }) |
        @Html.ActionLink("Delete", "Delete", new { id=item.CityId }) |
    </td>
</tr>
}
</table>

now I want put @Html.DisplayFor(modelItem => item.Caption) in the text of @Html.ActionLink("Edit", "Edit", new { id=item.CityId })

but i give an error from mvc.

  • 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-06-17T20:04:29+00:00Added an answer on June 17, 2026 at 8:04 pm

    Just use the correct method overload, like this:

    @Html.ActionLink(item.Caption, "Edit", "Edit", new { id=item.CityId }, null)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC Partial View that contains a Html.TextBox that is configured
I have this sort of format asp.net MVC View -> Service Layer -> Repository.
i have the following code in an asp.net mvc view. <% = Html.DropDownList(Filter, new
I'm on a asp.net MVC 2 project and have a view that inherits from
I have the following view definition in my asp.net mvc website: <% Using Ajax.BeginForm(UsrCtlChangePassword,
Greetings! I'm doing a Form on ASP.NET MVC 2, in my view I have
I have an ASP.NET MVC view on which I've placed jQuery tabs. I'm loading
I have an ASP.NET MVC view and related model. How can I fill its
I have a ASP.NET MVC 4 project and a SQL View (vvItem). ItemController MVCAppEntities
i have a strongly typed asp.net-mvc view and the Model has a . Links

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.