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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:54:55+00:00 2026-05-15T05:54:55+00:00

Actually im doing a home page that only have an action called Index() that

  • 0

Actually im doing a home page that only have an action called Index() that returns the view Index.ascx.

This index page will be composed by lastest news and lastest registered users, i think that create two partial views is the best idea (this way i could use it in other views).

for other hand i have a data access class that calls to database for get stuff (get last news, get last users, etc…)

My question is simple, should i call to the this data access class in the Index() action of my HomeController, and add to the ViewData the data obtained?

I think that this index() action shouldnt be the responsable of passing this data to the partial views, right?

Could you give me a hand?

im messing too much? 😉

Thanks in advance.

Best Regards.

Jose

  • 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-15T05:54:56+00:00Added an answer on May 15, 2026 at 5:54 am

    I suggest you use Action methods to control only to decide display content and not what it displays.

    I would say encapsulate the Data Access logic in one more layer , so that it is loosely coupled from the controller actions.

    This results in having ‘Thinner actions and Coarser Models’ . You might want to use a repository pattern as described in Scotts blog or follow Domain Driven Design which illustrates the responsibility of each of the layers.

    Hope this helps.

    Thanks ,
    Vijay

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

Sidebar

Related Questions

1st I have to say I know nothing bout php. I was actually doing
Actually if i am doing INNER JOIN of two tables then i will get
Actually, this question seems to have two parts: How to implement pattern matching? How
Actually, I'm using this way. Do you have a better way? private bool AcceptJson(HttpRequest
I know that there is already a question (actually some more) about this, but
In my simplified example of what I'm actually doing, let's say I have 2
Actually We are doing thesis work where we need to make 10 voip phones
Actually my question is all in the title. Anyway: I have a class and
Actually in the center of current view, above all other objects. Cross-browser and without
Actually I have two questions. (1) Is there any reduction in processing power or

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.