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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:46:22+00:00 2026-05-10T20:46:22+00:00

I am having some trouble grasping some concepts behind the MVC framework. I am

  • 0

I am having some trouble grasping some concepts behind the MVC framework. I am doing a very simple application which categorizes products.

The Creation screen will simply use a dropdown list showing the list of categories, the name of the product and submit.

On a normal .Net app, I would databind a server dropdownlist in the Page_Load, but in a MVC app, what is the best way to retrieve my categories from the database and add them to the dropdown list?

(Sorry, my question is extremely noobish but unfortunately resources are spare on MVC, and examples are often broken due to early changes)

  • 1 1 Answer
  • 3 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. 2026-05-10T20:46:22+00:00Added an answer on May 10, 2026 at 8:46 pm

    I’m not sure if I totally grasp, but if your page is displaying a single product and the only user input is just to select a category from a drop down list, I can sorta help (but I’m a noob too!).

    Referencing this page:

    http://weblogs.asp.net/scottgu/archive/2008/05/27/asp-net-mvc-preview-3-release.aspx

    You are going to want to create a SelectList in your controller for Categories (probably referencing an ID, and displaying a Name). You then add this SelectList to your ViewData. You could alternatively set this as part of your ViewData.Model and reference that from your View.

    In your view you use the HtmlHelper for DropDownList that takes a SelectList as a parameter.

    That link above should convey it much better, this is just a quick summary. That link is for preview 3, but I think it should all still apply.

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

Sidebar

Related Questions

Having some trouble with what should be a very simple scenario. For example purposes,
I´m having some trouble deciding in which way to go... I've got this application
I having some trouble figuring this problem out where I have one button which
After having some trouble with object deletion, I ran a simple test: Created a
Having some trouble using basic authentication with a simple test Wcf service. I am
As I'm extremely new to java, I seem to have trouble grasping some concepts.
Been having some trouble trying to integrate the admob sdk into my application to
Im having some trouble with my MVC model in java. Im passing in an
having some trouble creating a trigger across databases. I am doing this query through
I seem to be having some trouble grasping the concept of using AS to

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.