0
votes

I designed a web site with MVC3 technology. i have a main view and partial view. in partial view i have dropdownlist that shows name of cities and partial view is in main view. i want when user select a city (from partial view) and then submit click(in main view) get and save selected value in database.

partial view i have viewmodel that has selectid for selected value. @html.dropdownlist("selectid",new SelectList(Model.Lcitylist, "Value", "Text"))

how i can get selected value from partial view? please help me thanks a lot

1

1 Answers

1
votes

Your post action should have an argument called selectid, it will contain you selected value. It works the same if your drop down list is in your main view or in a partial view, as it is based on the name you give to you drop down list.