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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:25:45+00:00 2026-05-20T11:25:45+00:00

I feel stupid asking this but I cant seem to get a partial view

  • 0

I feel stupid asking this but I cant seem to get a partial view rendering in a page.

I have created a partial view that im trying to load into my index page. I have called my pv _BusinessDetails basically its a view that returns some customer data.

My pv looks like

@model MyMVC.Models.BusinessModel
<div class="grid">

<div class="grid-header">
<div class="gh-l"></div>
    <div class="gh-m">Business Details</div>
<div class="gh-r"></div>
</div>

<div class="grid-row">
     <label class="labelBold">Busines Name</label>
     <label>@Model.BusinesName</label>
</div>

</div>

From my index page I am trying to call the pv using

    @Html.Partial("_BusinessDetails")

which fails so if I add

@Html.Partial("_BusinessDetails",new MyMVC.Models.BusinessModel())

The partial view is loaded however with no data as the controller isn’t been hit. In my controller I have tried

public ActionResult _BusinessDetails()
  {
      return PartialView("_BusinessDetails");
  }

 public PartialViewResult _BusinessDetails()
    {
        return PartialView("_BusinessDetails");
    }

However neither of them are hit. What have I done wrong?

  • 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-20T11:25:46+00:00Added an answer on May 20, 2026 at 11:25 am

    When rendering a partial view and passing a view model, that view model should already be populated. No controllers/action methods are invoked when using @Html.Partial().

    Since you are using this strongly-typed partial view on your home page, consider building its view model in your HomeController‘s Index() method. Is your index page strongly-typed as well? If so, you can add your partial view’s view model as a property of your index page’s view model, and pass that when calling @Html.Partial().

    On your index page, it would look something like:

    @model MyMVC.Models.IndexViewModel
    <!-- some HTML here -->
    @Html.RenderPartial("_BusinessDetails", Model.BusinessModel)
    

    If your index page is not strongly-typed, you can use the ViewBag object or you can strongly-type it to MyMVC.Models.BusinessModel and use @Html.RenderPartial("_BusinessDetails", Model) (which, while simple, could cause confusion).

    Rachel Appel has a nice blog post, as does Mike Brind, if you would like more information.

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

Sidebar

Related Questions

I feel really stupid for asking this but I have been thrashing for over
I feel stupid asking this question, but I've been wrestling with it for hours
As a Rails developer I feel a bit stupid asking this question but hopefully
ok... so I feel really stupid asking this question.. but just wondering about the
I feel incredibly stupid for asking this, but the documentation and Google are giving
I feel stupid for asking this, but I've tried a couple things and I'm
I have such a simple question, I feel stupid for asking it. I can't
I feel like this is a stupid question because it seems like common sense
I feel that my shop has a hole because we don't have a solid
I feel like I should know this, but I haven't been able to figure

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.