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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:55:46+00:00 2026-05-26T04:55:46+00:00

I have an MVC3 C#.Net web site and I have a lookup table Methods

  • 0

I have an MVC3 C#.Net web site and I have a lookup table “Methods” in SQL server. I want to create a drop down list that populates the list of values from the “Name” column in my “Methods” table. I have an object, “Task”, that has a string property “MethodName”. I want to attach the selected value from the Drop Down list to this property in the Task object. How do I do this?

  • 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-26T04:55:46+00:00Added an answer on May 26, 2026 at 4:55 am

    Make a model that contains a task and a list of methods.  Get all the methods and the task you want from db in your “custom” model. Pass the model into your view

    Set in your view in the top @model NameProject.Folder.Modelname 

    Then add to your view: 

    List<SelectListItem> items = new List< SelectListItem>();
    

    Foreach(var m in Model.Methods)  {
       items.Add(new SelectListItem{Value=@m.Id.toString() , Text=@m.MethodName}) 
    }

     Then you could use html helpers that can help you bind model

    @Html.DropDownListFor(model => Model.Task.Method, items)
    

    In your controller that gets the post request use your model with task and methods as a parameter then just validate and savechanges

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

Sidebar

Related Questions

I want my web server code (invoked from ASP.NET MVC3 site's controller) to be
I have .net mvc3 web site. And i must to implement top menu. Each
Assume we have an ASP.NET MVC3 Web site that makes use of Entity Framework
I have a web site using .NET 4 and ASP.NET MVC3 running in IIS
I have a web site written using ASP.NET MVC3. The site has one single
I have an MVC3 C#.Net project. When I initially load my Web site, I
I have an MVC3 C#.Net web app. I have a requirement to display a
I have an MVC3 C# .Net web app. The app works fine when launching
This is about asp.net mvc3 web application. We have used Object cache to store
I have a C# .Net web app using MVC3. I am using Aspose 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.