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

  • Home
  • SEARCH
  • 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 1082093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:15:10+00:00 2026-05-16T22:15:10+00:00

this question is not about code, at least not about code that gives errors.

  • 0

this question is not about code, at least not about code that gives errors. I am asking this question to know the right way of implementing a pattern in ASP.NET MVC2.

Suppose that I have A Contact object that holds a collection of EmailAddress object. In My ContactController I have regularly actions that do create/edit/delete contacts from the underlying store. Inside my Index View (that render all the contacts) I have a link that says “Add Email” when a Contact is selected in the list.

Now I have at least two ways to implement this Action:

  1. Inside the ContactController add a AddEmailAddress action that pre-populate the EmailAddress Model object with the ContactID property and render a view
  2. As in the step 1 but instead of rendering a view delegate this job to a EmailAddressController class

Which is the correct way to handle patterns like this one?

Thanks in advance!

  • 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-16T22:15:11+00:00Added an answer on May 16, 2026 at 10:15 pm

    I like #1 better. Unless there is a big need for working with Emails separately outside the context of the Contact they go with, I think that’s the way to go.

    But if you’re going to have List Emails, Delete an Email, Create an Email, Edit an Email, etc. screens, then having it’s own controller would make more sense. In that case, I would have the hyperlink browse to the email controller and the create action with the contact id as an argument in the URL.

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

Sidebar

Related Questions

No, this is not a question about generics. I have a Factory pattern with
I asked a similar question about this previously, but I did not specify that
This question is NOT about race-conditions, atomicity, or why you should use locks in
(NOTE: This question is not about escaping queries, it's about escaping results) I'm using
This is a question not really about programming (is not specific to any language
This question is about removing sequences from an array, not duplicates in the strict
Ok this is a general question about how to solve this issue, not to
This is mostly a theoretical question I'm just very curious about. (I'm not trying
I know this question may sound silly, but I am learning (at least trying)
This question is not so much programming related as it is deployment related. I

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.