how to display selected value in drop down list in asp.net mvc? -


I want to display the selected value in the drop down list. The value comes from the data base. Assume that we want to update the user profile for the past, the value for the gender, which is previously provided by the user, should be displayed as the selected value. Code that I used to display

   ToString (Model.gender); SeeData ["General"] = Well; & Gt%; & Lt;% = Html.DropDownList ("Linglist", see Data [Selection list as "General"])% & gt;  

But this is not showing value from the database. But the viewdata gets the value from the database but it is not appearing on the drop down list. thank you in advanced.

You can view blog posts that show how to use dropdown list in ASP.NET MVC . .


Comments