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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:37:51+00:00 2026-05-14T15:37:51+00:00

ASP .NET MVC 1 I’d like to show a partial view base on a

  • 0

ASP .NET MVC 1

I’d like to show a partial view base on a model, and I’d like that to have a fairly short command for that. So I saw a way of using both a HtmlHelper and a controller (And I’d use another controller for that, not the controller currently used).

But somehow it still gives an error, though I think the method starts to look as it should.

So what am I doing wrong? (If I call the method directly in the ASPX-page, it succeeds. But it should be possible to use a HtmlHelper for that).

public static void RenderPartialView(this HtmlHelper html, string action, string controller, object model)
{
    var context = html.ViewContext;
    RouteData rd = new RouteData(context.RouteData.Route, context.RouteData.RouteHandler);
    rd.Values.Add("controller", controller);
    rd.Values.Add("action", action);
    rd.Values.Add("model", model);
    IHttpHandler handler = new MvcHandler(new RequestContext(context.HttpContext, rd));
    handler.ProcessRequest(System.Web.HttpContext.Current);
}

Part in the ASCX-page:

<% Html.RenderPartialView("Show", "Intro", Model.Intro); %>

Error given:
‘System.Web.Mvc.HtmlHelper’ does not contain a definition for ‘RenderPartialView’ and no extension method ‘RenderPartialView’ accepting a first argument of type ‘System.Web.Mvc.HtmlHelper’ could be found (are you missing a using directive or an assembly reference?)

  • 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-14T15:37:52+00:00Added an answer on May 14, 2026 at 3:37 pm

    Add

    <add namespace="Namespace-Of-RenderPartialView-Class"/>
    

    to your web.config file.

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

Sidebar

Related Questions

In ASP.NET MVC I see I have handy HTML helpers that I can use
ASP.NET MVC Model Binding is still new to me and I'm trying to understand
in ASP.NET MVC 2.0 I'm doing something like the below (specifically, matching a record
ASP.NET MVC 2 + SQL Server Express...
ASP.NET MVC treats dot character as a literal for routes for a long time
Asp.net MVC 3 preview 1 was released at the end of last month. Are
My ASP.NET MVC 2 application runs under built-in local NETWORK SERVICE account. I want
In ASP.NET MVC 2 <%: tag was introduced to replace <%= for Html helpers.
With ASP.NET MVC it is pretty easy to integrate an IoC container to create
Using asp.net MVC in c#, I am making a call to a stored procedure

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.