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

The Archive Base Latest Questions

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

I have a Microsoft MVC project with an action Foo whose view (Foo.aspx) contains

  • 0

I have a Microsoft MVC project with an action “Foo” whose view (“Foo.aspx”) contains the lines:

<%= Html.ActionLink("mylinktext1", "bar") %>
<%= Html.ActionLink<MyController>(x => x.Bar(), "mylinktext2") %>

When I hit this from a web browser or load it from an AJAX call, it properly returns:

<a href="/bar">mylinktext1</a>
<a href="/Bar">mylinktext2</a>

But when I call the action from another view like this:

<% Html.RenderAction<MyController>(x => x.Foo()); %>

Then the links are rendered without targets.

<a href="">mylinktext1</a>
<a href="">mylinktext2</a>

Why would this be happening, and how do I work around it?

  • 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-13T18:30:16+00:00Added an answer on May 13, 2026 at 6:30 pm

    I don’t know if that is what you are doing wrong, but I have never used Html.RenderAction with actions that return ASPX views. When I call RenderAction, I make sure that I am calling a controller action that returns ASCX View User Control.

    Typically .ASPX file is an entire page and you can’t (shouldn’t) render this inside another page.
    So I think you should make it View User Control (ASCX) and put it either in Shared or in controller’s view folder.

    Based on your comment:
    Of course this is fine. You just return your data as model to your views/view user controls. When you load them thru AJAX, you should consider implementing Render View to String. Search the Google or Stack for more information on it. You can also search for a thing called JsonPox attribute for your action methods – also implemented somewhere on the internet. It will enable decorating your action methods so that they are able to return HTML view, XML or JSON if that’s what you also might need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a frustrating problem with an asp.net mvc view containing the Microsoft Chart
I have referenced both Microsoft.Web.Mvc.dll (MVC Futures 2) and MVCContrib.dll (from MVC Contrib 2),
I am trying to learn Microsoft MVC 2, and have in that case found
In my ASP.NET MVC application, I have the following setup: <runtime> <assemblyBinding xmlns=urn:schemas-microsoft-com:asm.v1> <probing
Intro I'm developing a project with MVC.Net. I have just started a default website
Does anyone have any basic instructions for setting up a first MVC project in
We want to use Html.RenderAction in our MVC1.0 project. I have downloaded the Futures
I have created a MVC 3 WCF Rest project using the tutorial described here
I've an ASP.NET MVC project that has a sub folder called emails. This contains
I have just created a new MVC 3 project and updated all the installed

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.