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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:44:05+00:00 2026-05-14T04:44:05+00:00

As I understand it, in ASP.NET MVC a httprequest is mapped to a controller/action.

  • 0

As I understand it, in ASP.NET MVC a httprequest is mapped to a controller/action.

  • As one request is used to get one web page, could we call to these controllers “page controllers“?

My other question is about widgets (user controls) and RenderPartial method:

  • If a widget represents a classic ASP.NET webcontrol or usercontrol, and I want to render this widget in a lot of pages, how could I avoid repeating the logic of the widget if this logic is in the “page controller“?
  • 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-14T04:44:05+00:00Added an answer on May 14, 2026 at 4:44 am

    As one request is used to get one web page, could we call to these controllers “page controllers”?

    Why would you? They’re named controllers. After all, an action on a controller doesn’t neccessarily serve a “web page”, it might respond using JSON data, XML, RSS or only a part of a web page (a ‘control’ if you want).

    If a widget represent a classic asp.net webcontrol or usercontrol, and i want to render this widget in a lot of pages, how could avoid repeat the logic of the widget if this logic is in the “page controller”?

    1. Make sure your (business) logic is not in the controller: it doesn’t belong there. The controller’s job is to map input/output, not to handle logic.
    2. The views that contain your widget should have a ViewModel which contains the ViewModels needed in the widgets, e.g.

    –

    MainViewModel
    {
        UserWidgetViewModel UserViewModel;
        List<Foo> Bar;
        // ...
    }
    
    UserWidgetViewModel 
    {
        string UserName;
        int Reputation;
        //...
    }
    

    I felt this unelegant first, but I’ve been using this for some time now and I believe it nicely encapsulates the necessary data.

    Hope that helps

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

Sidebar

Related Questions

I have an ASP.Net MVC Page with a very simple form on it: One
I'm using the MVC beta to write a simple application to understand ASP.Net MVC.
I understand that the AntiForgeryToken feature in ASP.NET MVC does prevent cross-site attacks. However,
I noticed that there is one change about ASP.NET Routing. I cannot understand why
I have decided to use ASP.NET MVC to develop multi page (registration) forms in
I'm using ASP.NET MVC 2 and I'm struggling to understand how can I use
I ve gone through sample asp.net mvc nerd dinner application... But still cant understand
I'm building an ASP.NET MVC site where I want one of the Views I
ASP.NET MVC Model Binding is still new to me and I'm trying to understand
Can somebody provide a working example of JavaScriptResult in asp.net mvc. I understand that

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.