[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

populating Select box in MVC3 view

Posted on 2011-09-12
2
Medium Priority
?
690 Views
Last Modified: 2012-08-13
i want to populate below mentioned html control in MVC3 view can any body tell me how i will populate this control dynamically
i am getting my data in controller

 [HttpGet]
        public JsonResult Gettestdata()
        {  
            var data = ServiceName.Getdata();
            return Json(data, JsonRequestBehavior.AllowGet);
        }

This html control need to populate with above data which is pulling by [HttpGet]
<select id="control_7" name="control_7[]" multiple="multiple" size="5">
                              <option value=""></option>
                              <option value="option_1">Option 1</option>
                              <option value="option_2">Option 2</option>

                              <option value="option_3">Option 3</option>
                              <option value="option_4">Option 4</option>
                              <option value="option_5">Option 5</option>
                              <option value="option_6">Option 6</option>
                              <option value="option_7">Option 7</option>
                        </select>
0
Comment
Question by:farjack1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
sonawanekiran earned 2000 total points
ID: 36527456
Check this http://277hz.co.uk/Blog/Show/10/drop-down-lists-in-mvc--asp-net-

You need to call Gettestdata in ConstructDropDownListOptions method
0
 

Author Comment

by:farjack1
ID: 36535701
Actually above i mentioned i am using Select box not Html.DropDownListFor, can you give me exp. for Select box.

Thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question