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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:11:06+00:00 2026-05-23T12:11:06+00:00

Recently I faced an ugly problem in my project when I begin the design

  • 0

Recently I faced an ugly problem in my project when I begin the design of a complex View which have to handle with many data sources. The purpose of the View is to show data related to the profile of a Customer but this profile it’s made of:Basic Info, Project involved, financial data and contact info. All that data must be grouped in the same View and must be updatable. Additionally to this, in the right pane of the view, there are a few of widgets pointing to other sources not related with the customer information.
My approach to solve this was:

  1. Create an hybrid model which it’s a mixed of various models like: personalInfoModel, cutomerProjectModel, financialInfoModel, and contactInfoModel. By the way, I am using Microsoft entity framework, so every model here match with an entity one to one.
  2. With this hybrid model, I make the connection to the main View (let’s say CustomerView) so in the first line of the view code you can see something like:

    <%@ Page ..... Inherits="...MyProject.Models.hybridCustomerModel"
    
  3. Inside the main view I use:

    <% Html.RenderPartial("UC_BasicInfo"); %>
    <% Html.RenderPartial("UC_ProjectInfo"); %>
    <% Html.RenderPartial("UC_FinancialInfo"); %>
    <% Html.RenderPartial("UC_ContactInfo"); %>
    

    This is because I want to simplify things a bit by mean of user controls for rendering of the main View.

  4. Every User Control (¨*.ascx), is pointing to the hybrid model so I can make the binding in the controls of the forms without problem.

  5. In the controller the things looks a little disordered. For every *.ascx there is an action’s Method handling the “post request”. But the initial loading or Get request, is made inside the only action method which match with the View Name: CustomerView.
    For the purpose of usability and responsiveness I use jquery to make the post request.
    But the problem is that I need to make a lot of work Mapping the hybrid model with the plain model involved in the Post Request, because the DATA layer receives only the model which maps with every entity created by the Model.

  6. Finally, I am using: <% Html.RenderAction() %> for the Widgets at the right pane of the view in order to get data out of the hybrid model I am using.

I wanted to ask you if there is some different and better approach in this case?

  • 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-23T12:11:07+00:00Added an answer on May 23, 2026 at 12:11 pm

    I think there are a couple of approaches you could use to simplify this.

    Firstly instead of the hybrid view, why not make up a view-model class. This will contain your hybrid data, but will be a pure poco class. Its much safer to bind to, as you control what fields are exposed.

    Having a controller method for each ascx is not such a bad thing, but if you prefer one, and to wrap the page in one Form, you can either use button type=”submit” (rather than input type=submit) or javascript to tell which button was pressed and which bit of the posted viewdata to map back to your EF classes.

    Another approach, and given that you have already taken a dependency on javascript, this is the one I would favour:

    I’d attempt to decouple the page into the independent partials, give each one a pair of controller methods (Get and Post) and assemble the page by requesting each partial with Ajax type calls. Your sticking point here will depend on whether an update in one cascades into others : if the interdependence is fixed and acyclic this will be pretty easy to resolve otherwise you might need to develop some sort of light messaging framework – or just allow some types of update to trigger a full page refresh.

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

Sidebar

Related Questions

We have recently been faced with the problem of porting our C++ framework to
I've recently faced a problem involving passing data (small amount), from a page to
I recently faced a problem of presenting the output of simple genetic algorithm that
I recently faced a problem about combining unit tests and doctests in Python. I
Recently I have been investigating the possibilities of caching in ASP.NET. I rolled my
I recently faced an interview question related to LINQ. What is the use of
I recently faced a strange behavior using the right-shift operator. The following program: #include
I work for a very small company. I was recently faced with the question
Recently I faced a issue when using len() in a query to find out
Recently I faced few interview questions.The interviewer asked the to give the detailed answer.

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.