Click here to Skip to main content
15,886,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i am binding data to dropdownlist with viewmodel dynamically.but while i submit data to server i am getting argumentnullexception.

data is binding to the dropdown but i am not to send the data to server

can you please solve my problem.

HTML
@Html.DropDownListFor(m => m.VerticalID, new SelectList(Model.naVertical, "VerticalID", "Name"), "Select Vertical")


C#
public class NAVertical
  {
      public int VerticalID { get; set; }
      public string Name { get; set; }
  }



regards,
syed
Posted
Comments
[no name] 16-Sep-14 4:06am    
Check your form post menthod in the viewpage and use console to check the content of form post. And try use a object selected value.
@Html.DropDownListFor(m => m.VerticalID, new SelectList(Model.naVertical, "VerticalID", "Name","Select"), "Select Vertical")

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900