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

Creating an object from a DropDownList

1 Answer 37 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jared
Top achievements
Rank 1
Jared asked on 04 May 2015, 07:41 PM

I have a form with a drop down list inside of it.  When the form is posted I want the data in the drop down list to be written into Class B, which is an attribute of Class A on the MVC side.

Can this be done?  Is there any way to format or pull the data from the Drop down list directly into Class B, which is inside of Class A?  Is there some way to map the input from the drop down list to this element?

 

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 06 May 2015, 11:50 AM
Hello Jared,

You can achieve this either by using a custom model binder on the server side, or by subscribing to the form's submit event and modifying the values before posting them.

Regards,
Alexander Popov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
General Discussions
Asked by
Jared
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or