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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:21:08+00:00 2026-05-16T14:21:08+00:00

I am used to working with ASP.NET FORMS and I am having a hard

  • 0

I am used to working with ASP.NET FORMS and I am having a hard time understanding MVC.NET.

If I in WebForms would create a profile page for a user, it would consist of an aspx page with several usercontrols added on the page, which all does something differently.
One control might show the latest posts by the user, another the friends connected to the user etc.

But how would this be done in MVC.NET?

Am I supposed to create several views for each user control, or am I supposed to create one huge model which contains all the data I need on the page and then feed it to the view?

  • 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-16T14:21:09+00:00Added an answer on May 16, 2026 at 2:21 pm

    For me, if a the partial view (.ascx or usercontrol in asp.net forms) has a lot of dynamic contents on it, I will make it a strongly typed view. Which means it has its own Model. Depending on its usability. But I strongly advise make each Views its corresponding Model.

    For example, in this situation, you have a partial view that has a Model of Address

    Partial View

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Address>" %>
    
    Address Name: <%=Model.AddressName %>
    Address Location: <%=Model.AddressLocation %>
    

    Model

    public class Address
    {
         public string AddressName {get;set;}
         public string AddressLocation {get;set;}
    }
    

    And I want to use this Partial View of mine depending on the page that is using. Could be the Login User or the Friends User. What I would do is just call its Corresponding Action in a Controller.

    Say I put it in the CommonController

    public class CommonController : Controller
    {
         ModelRepository modelRepository = new ModelRepository();
    
         public PartialViewResult AddressPartialView(int id)
         {
              var address = modelRepository.GetAddress(id);
              return View("AddressPartialView", address);
         }
    }
    

    In this case I can call this Partial View in any Part of any page by

    <%= Html.Action("AddressPartialView", "Common", new { id = Model.AddressId })%>
    

    assuming my View that I was calling the Partial View has a Model of User with a property of AddressId. This way, I can use and reuse my Partial View in 1 single page, each got different content.

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

Sidebar

Related Questions

I have used JQuery within my asp.net page. JQuery is working fine. I could
I am working on an ASP.NET 4.0 web forms project that uses page routing
Technology Used:- Asp.Net 2.0 Code:- See Below Description:- hello code given below is working
i recently was working on an ASP.NET MVC site that basically serves static html
In my asp.net webforms application I am using plain and simple forms authentication hooked
I am using the built-in forms authentication that comes with asp.net mvc. I added
I'm working on a heavily data driven ASP.NET web forms application. We're using the
I'm working on an application using ASP.NET MVC 1.0 and I'm trying to inject
I'm working on an ASP.NET webforms app that will serve as a simple intake
I am working in Slider Concept in ASP.NET MVC 2. slider code snippet <script

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.