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 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

asp.net mvc 3 with razor I have a script inside a partial view <script
With ASP.net MVC I have a Model like so: public class Project { public
Using Asp.net MVC, I have one view that's strongly bind to List , and
ASP.NET MVC 2.0: Simple Model Binding not working/binding as it should i have a
ASP.Net MVC Controllers have several methods of forwarding control to another controller or action.
ASP.NET MVC 2 will support validation based on DataAnnotation attributes like this: public class
ASP.NET MVC web app that exposes friendly URLs: http://somesite.com/friendlyurl ...which are rewritten (not redirected)
Using ASP.Net MVC on my Site.Master I have: <head runat=server> <title><asp:ContentPlaceHolder ID=TitleContent runat=server />
ASP.NET MVC helpers generates URLs with slash, I use <base /> tag for my
ASP.NET MVC 2 has powerful features for generating the model-dependent content of the Edit

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.