This is a migrated thread and some comments may be shown as answers.

[Solved] Dropdownlist selected value on model

0 Answers 42 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 12 Apr 2012, 06:42 PM
I am just starting to use Telerik controls. I am trying to get the selected value from a dropdownlist to automatically bind to model. Here is my code

@(Html.Telerik().DropDownList()

.Name(

"ClientDropDown")

.HtmlAttributes(

new { style = "width: 200px" })

.BindTo(

new SelectList(Model.Clients, "ClientId", "ClientName", Model.SelectedClientId))

)


But the value returned in the controller method is always zero. Any ideas what is wrong?

Thanks,
Tags
ComboBox
Asked by
John
Top achievements
Rank 1
Share this question
or