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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:30:21+00:00 2026-06-04T08:30:21+00:00

I have an ASP.Net MVC 4 view that is supposed to conditionally render an

  • 0

I have an ASP.Net MVC 4 view that is supposed to conditionally render an ActionLink. However, the ActionLink does not render in the final output. To diagnose the issue, I added text before and after the desired ActionLink, and also duplicated the ActionLink code outside the if body.

The result is that the ActionLink code outside of the if body, as well as the before/after text, renders but not the ActionLink I actually want.

@Html.ActionLink("NEXT", "_NextPage")

@if (true /*!Model.IsFinalPage*/) {
    <text>Pre</text>
    Html.ActionLink("NEXT", "_NextPage");
    <text>Post</text> 
}

Output:

NEXT Pre Post

(NEXT is an appropriate link)

  • 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-04T08:30:22+00:00Added an answer on June 4, 2026 at 8:30 am

    The action-link needs the @ to work here.

    In razor, plain-old Html.ActionLink returns the html-string, but it doesn’t get written to he buffer without the @. so

    @Html.ActionLink 
    

    would be the same as

    Response.Write(Html.ActionLink);
    
    • 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 3 view using Razor and Knockout.js that is not
I have an ASP.NET MVC Partial View that contains a Html.TextBox that is configured
For fields in my ASP.NET MVC view that have been attributed as required, is
I'm on a asp.net MVC 2 project and have a view that inherits from
Using Asp.net MVC, I have one view that's strongly bind to List , and
i have an asp.net mvc view that with the help of jquery ajax updates
Example is fake. ASP.NET MVC: I have a view that renders a student info.
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 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.