views:

195

answers:

1

Hi, I have many pages with many dropdowns in them and I am wondering whats the best practice for filling all those dropdowns in an MVC 2.0 app, am thinking of creating a template for all because I wanna use special script on each one, but what about using ajax to initially load the dropdownlist items values. maybe through creating a controller specifically for pulling the values for dropdowns and returning as jsonresults.

any ideas about doing this , in a better way?

The most important part for me is what would be the best approach to load all those values into a single view

A: 

I agree with SF. You could use a component library which allows you to prepare your data in a more user friendly manner such as RichFaces, or iceFaces. If dropDowns is your thing, both component libraries have lots of different options for dropDowns and in you can specify a backing class which could act as your template although you should avoid them if possible, bindings allows you to programmatically create dropDownMenus (in Richfaces anyway).

Mark Lewis
Thanks Mark, I am all for using a unified way to do so, and in fact I am trying to create a template so that I am not gonna be stuck with one look and feel for the app, The most important part for me is what would be the best approach to load all those values into a single view
Laith
Maybe check out Data Iteration in teh RichFaces demo. I'm using at the moment, and it's a learning curve but attractive.
Mark Lewis