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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:23:09+00:00 2026-05-24T08:23:09+00:00

In my MVC3 app I am using some child actions (RenderAction()) to populate 2

  • 0

In my MVC3 app I am using some child actions (RenderAction()) to populate 2 parts of my view. This helps me keep the code more modular and reusable. The problem is that the controller constructor is getting called again for each child action.

In my controller constructor I make a few calls to the database to get user data. They aren’t expensive calls but when each child action has to make the same call it starts to add up. I’m sending duplicate queries off to the database for the same HTTP request.

Is this normal behavior? Should I stay away from child actions?

  • 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-24T08:23:10+00:00Added an answer on May 24, 2026 at 8:23 am

    Yes – this is normal behaviour. Child actions go through the entire ASP.NET MVC processing pipeline, just like regular actions.

    If you want to avoid this, then use a Partial View. Of course, this way you’ll lose the ability to perform logic in your child action.

    If your saying your “calling a few child actions”, and “each action makes the same call to get user data”, i think you need to do some refactoring. Maybe you could put this “user data” call in a child action, and apply output caching. If your talking about the “current user data”, then you might be able to also stick it in the forms authentication ticket, and skip the DB call altogether. Hard to give more advice without knowing more about the situation.

    The other point i’d make is why are you making database calls in a constructor? This is very bad practice. Use the constructor for instantiating members and setting up dependencies, not retrieving data.

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

Sidebar

Related Questions

I have this web app created using MVC3 and need to make a Windows
Have an ASP.NET MVC3 app with model validation using FluentValidation . User enters some
For some reason emlah is not logging missing images in my MVC3 app. Everything
While developing my app (asp.net mvc3) locally everything was fine using the VS dev
I am working on an asp mvc3 app that is using .NET 4 .
I have a C#.NET MVC3 web app and I have some common jQuery functionality
I have a C#.NET MVC3 web app and I have some common jQuery functionality
Here is the the thing. I'm using ASP.NET MVC3 to build an app and
I'm confused by this behavior: I have an out-of-the-box MVC3 app. I haven't really
.NET/MVC3 newbie, so please bear with me! I've searched for this answer all over

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.