?
Solved

populating Select box in MVC3 view

Posted on 2011-09-12
2
Medium Priority
?
688 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

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…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…
Suggested Courses

765 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