Click here to Skip to main content
11,576,354 members (61,391 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: MVC3 MVC4
hello every one..

i have facing problem related to dropdownfor in MVC4.
i have a page "Index.cshtml". on this page i have one dropdownlist and one button named "btnDdl".
i have open a popup window "popupwindow.cshtml" on button click.
On popupwindow.cshtml i have one textbox and one button named "btnText".
i want to add textbox value(witch entered by user) into dropdownlist when clicked on button (btnText) and open popup window closed.

Posted 2-Nov-12 5:22am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

1) Do these two views share the same ViewModel? If so then you can add the applicable values to the ViewModel and use that model to get the data back and forth.
2) If these two views use different ViewModels, you can add the values in question to each ViewModel and then use controller code to transfer the value from one model to the other.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 251
1 Abhinav S 135
2 Lucifier Rocks 105
3 Dave Kreskowiak 80
4 F-ES Sitecore 80
0 OriginalGriff 705
1 Sergey Alexandrovich Kryukov 626
2 Abhinav S 483
3 F-ES Sitecore 410
4 Suvendu Shekhar Giri 365

Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 2 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100